Skip to content

Multiphase Transpilation#356

Merged
Perryvw merged 94 commits intomasterfrom
ts-to-lua-ast
Jan 27, 2019
Merged

Multiphase Transpilation#356
Perryvw merged 94 commits intomasterfrom
ts-to-lua-ast

Conversation

@lolleko
Copy link
Copy Markdown
Member

@lolleko lolleko commented Jan 24, 2019

Chaining our transpilation pipeline from:

TS Code ----> TS AST ----> Lua Code to
TS Code --tsc--> TS AST --transformer--> Lua AST --printer--> LuaCode

See issues for more details.

Closes #278, Closes #286

lolleko and others added 30 commits November 22, 2018 11:25
* Initial Transformer Setup

Added Transformer setup that allows us to incrementally port our transpile functions to transform functions.

We have to prot all transpile functions that transpile Nodes that are not allowed in the 2nd AST.

Once thats done we should restrucutre the whole project, because right now the transform process is just hacked before the transpilation.

* Moved import path resolving from the transpiler to the transformer
* Addded NS Transformer

* Added block transformation

* Fixed manual block visit not being flattened

* Flag var statements as static if no module exists

* Revert "Merge branch 'master' into transformer-namespace"

This reverts commit 773afae, reversing
changes made to 743912a.

* Removed statement static mod

* Added a lot of transformers for expressions and statements

* Added remaining implementations for transforms

Transfrom & Transpile works now but there are still soem feature missing
Many tests (especially translation) will fail aswell.

* Fixed bug with default values for constructor parameters

* Lualib omit when unused (#280)

* lualib inline omit header when no features are used

* Tests to enforce no lualib text when unused, unless using always

* Fixed wrong version (git fail)

* Updated alsatian

* Improved empty block handling

* Added empty lines between functions
* Lua AST draft

* Rrnamed TableAccess

* Renamed TableAccessExpression SyntaxKind

* Added MethodCallExpression

* Added AST node create functions
* support in transformer for assignments

* fixes for feedback and issues found in tests
lolleko and others added 13 commits January 20, 2019 20:51
* Fixing remaining tests
- Fixed exporting enum members
- Fixed exporting namespace members in a non-module
- (Re)Fixed recursive functions
- Updated transformation tests with aesthetic changes

* corrected class export transform tests (which re-breaks them right now)
# Conflicts:
#	src/Transpiler.ts
# Conflicts:
#	src/Errors.ts
#	src/Transpiler.ts
#355)

* fixed additional issues with exported classes and a few transform tests where functions are now declared local

* local/global/export logic fix
- function and var are global unless inside a module, namespace or function
- everything else is local
- functions and function expressions properly separate declaration from assignment for recursion now
- transform tests updated
- also fixed noHeader not being respected when building lualib
@lolleko lolleko added this to the 1.0.0 milestone Jan 24, 2019
@lolleko lolleko requested review from Perryvw and tomblind January 24, 2019 20:43
TheLartians and others added 5 commits January 26, 2019 13:48
* fix-lua-identifier

* added test
* fix accessor assignment

* add test

* add brackets
* prefix import identifiers

* refactor TSTL identifier function

* update transformation tests
* Removed clang

* Set codecov target back to 90

* Small formatting and typo fixes

* Removed clang-format

* Fixed PR issues

* Fixed clean

* Made a factory method for selfIdentifier, instead of reusing the same node
TableIndexExpression,
// Operators
// Arithmetic
AdditionOperator, // Maybe use abreviations for those add, sub, mul ...
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a lot of comments in this file that might make sense to remove now

- formatting fixes
- removed redundant escapeString function
- fixed return type of isIterationStatement
- removed a comment
#364)

* Removed todos

* Changed tstl.create* parameter order to remove a lot of undefineds

* Removed copy pasted casts
@Perryvw Perryvw merged commit 52408aa into master Jan 27, 2019
@Perryvw Perryvw deleted the ts-to-lua-ast branch January 27, 2019 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework exports Multi Phase Compilation

5 participants