-
Notifications
You must be signed in to change notification settings - Fork 310
Python support for Fable 🎉 #2345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 151 commits
Commits
Show all changes
164 commits
Select commit
Hold shift + click to select a range
e7ec344
Initial Python POC
dbrattli db879d6
`return None` instead not nothing
dbrattli f46b933
This is not a reserved word in python
dbrattli 3fd17eb
Generate .fs.py files instead
dbrattli cee5615
Fable is now a separate module in Expression
dbrattli cfb7ed0
Fixes for undefined, null, and ofArray (of_seq)
dbrattli d052a92
Python AST (wip)
dbrattli f893abc
Update Python AST
dbrattli 69c1177
Transform from Babel AST to Python AST
dbrattli 900dc24
Revert
dbrattli e68eeda
Revert
dbrattli bd36059
Revert
dbrattli 680a9f8
Fix import statement
dbrattli 591a93a
Fix expression statements
dbrattli a6344f2
Add language handling
dbrattli 0701377
Fix Babel expression to Python statements
dbrattli c0268eb
Fixes for class definitions
dbrattli 86a9fa6
Fix fable library imports
dbrattli 2b1e138
Revert newline changes
dbrattli fb50321
Fix more newlines
dbrattli e987802
More newlines
dbrattli 6d14a28
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli 9dda9e6
Fix comparison operators
dbrattli 08328c4
Fix subscript operator
dbrattli aa7013e
Fix single line lambda
dbrattli e1595d7
Fixes for while and for loops
dbrattli 3324b81
Lift arrow and function expressions to function definitions
dbrattli 5b58e79
Print bases for classes
dbrattli 2cecd0c
Better name mangling of extracted functions
dbrattli c83eb2c
Fixes for python dicts
dbrattli b30cea9
Move isProductive transformation out of the Python AST
dbrattli 5db9b89
Translate `void 0` to None
dbrattli 53d0312
Fix local imports
dbrattli 3863ca8
Add pyNative and Fable.Core.PyInterop
dbrattli 8540447
Try out active patterns
dbrattli 875a469
Rewrite Python AST to DU / Records
dbrattli 6c86af2
Fix assingments
dbrattli 183dd84
Fix build script.
dbrattli 7e7913a
Initail support for switch statements
dbrattli a68cbd3
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli 52dc5f6
Merge
dbrattli 12c4816
Fixes for sequence expressions
dbrattli ac1fb28
Fix exception message handling
dbrattli 1756237
Fix argument annotations
dbrattli b2a8ab6
Fix lifting out of object properties
dbrattli 4215d95
Handle varargs
dbrattli 02309fb
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli 627289f
Revert changes
dbrattli 3ab4ed5
Merge remote-tracking branch 'origin/babel-unions' into python
dbrattli b37affe
Refactor to babel unions
dbrattli dc1f822
Simplify pattern matching
dbrattli c676183
Pattern matching fixes
dbrattli 5c5d948
Add simple for-loops
dbrattli 880596f
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli c63973e
Cleanup
dbrattli ebd9868
Fix for length / str
dbrattli 0f87c3c
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli 559d79e
Refactor for latest Fable
dbrattli ce1741e
Refactor Python printer
dbrattli fec543d
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli d8189e8
Refactored Python AST extensions
dbrattli 15af659
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli 4209a4b
Better handling of babel member expressions
dbrattli be027a6
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli 102eb8b
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli e9caa73
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli 0d8fb62
Merge branch 'nagareyama' into python
dbrattli cbb90dd
Import fixes
dbrattli fded5c6
Fix import statement
dbrattli 3af2ade
Rename
dbrattli 06edc58
First test running
dbrattli 29f6129
Avoid importing Xunit for every test file
dbrattli 405a938
Add more tests
dbrattli f909256
Add more tests
dbrattli cf17446
Test list
dbrattli 634f181
Fix for member expressions
dbrattli 0515e5b
String interpolation
dbrattli 26b81e0
Merge branch 'nagareyama' into python
dbrattli 6518188
Better string testing
dbrattli 45fcad1
String tests
dbrattli b082f4f
Fix string test
dbrattli 8dba1d2
Fix sequence expression to lifted function
dbrattli d9f7c42
Fix nonlocals and print of iterables
dbrattli 34bef83
Fix nonlocal ordering issue
dbrattli 9317fbf
Fix tests
dbrattli 677b4bd
Set tests (wip)
dbrattli 30f9ba6
Add language selector arg `--lang` since ts, js and py are exclusive
dbrattli 044c11a
Be a little forgiving about language selection
dbrattli dc399fc
Better assignment handling. Handle len, str and iter for classes.
dbrattli 2d2fc03
Fix empty methods
dbrattli 6e27f39
Fix language handling
dbrattli 8c82c80
Fixes
dbrattli f0c66b3
Move Python fable-library to Fable
dbrattli 17e703b
Add ts option compatibility
dbrattli db90eea
Add option tests
dbrattli a156a62
Fix option test
dbrattli 7cf8821
Update fable-library for Python
dbrattli 0e1d2e1
Fix tostring, __str__ and str
dbrattli 6dd686a
Fix substring and join for string module
dbrattli df9e0bd
Add stringbuilder test
dbrattli 5f9f9eb
Add stringbuilder tests and fix member expressions
dbrattli 021ee83
Add stringbuilder tests
dbrattli a859e33
Add more string tests
dbrattli 4f0956a
fix install on windows
tengelskar 31685a0
Merge branch 'nagareyama' into python
dbrattli cb2ba24
Fix pyinterop
dbrattli 7c9d349
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli fa78716
Adding initial async support (wip)
dbrattli eba41be
Async fixes
dbrattli 0abd586
Fix async catch and ignore
dbrattli 6b15331
Nonlocal bugfix
dbrattli 18447c3
Merge pull request #2442 from fable-compiler/update-fcs
alfonsogarciacaro 7dd75e4
Merge branch 'nagareyama' of https://github.com/fable-compiler/Fable …
dbrattli 48af9b8
Fix merge conflict
dbrattli 6de0250
Initial version of Fable2Python.fs (wip)
dbrattli ac25680
WIP
dbrattli 0968fc0
Fix printing of pos only args
dbrattli 4dd84a7
Fix classes (wip)
dbrattli 97ec1a3
Fix class setters
dbrattli a70f8ea
Fable2Python (wip)
dbrattli 63826ba
Initial non-local handling (wip)
dbrattli 53f89ef
Merge branch 'next' of https://github.com/fable-compiler/Fable into p…
dbrattli 9d597ca
Import fixes
dbrattli a818b3e
Fixes for sequence expressions, for-loops
dbrattli 0812d22
Clean identifiers
dbrattli 586f538
Fix errors with empty body and array create
dbrattli 5eadd5f
Fix import identifier cleaning
dbrattli 956968f
Transform x.toString() into str(x)
dbrattli 484608a
Sort nonlocals
dbrattli e73fa6d
Fix emit expressions
dbrattli 0115f6d
Propagate nonlocals out of if and else blocks
dbrattli 705d6e3
Enable Fable2Python instead of Babel2Python
dbrattli 2ef3a00
Better cleaning of identifiers
dbrattli 146359b
Fixes for push vs append, indexOf vs find, length vs len, ...
dbrattli 9a60689
Fix tc arg names
dbrattli fe5481b
Merge branch 'next' of https://github.com/fable-compiler/Fable into p…
dbrattli eee5696
Fixes for sequence expressions + get dict
dbrattli a7294ed
Fixed var args for union type
dbrattli 516d9eb
Fix get attribute and exception raising
dbrattli ba679e5
Fix for dict getters
dbrattli fcd1d6a
Rewrite `.message` to `str`
dbrattli 5cc053f
Fix seq tests
dbrattli 8ee6a53
Add set tests
dbrattli 4e33158
Fixes for object expressions
dbrattli 827f0d9
Use subscript access for anonymous records
dbrattli 5106a41
Fixes for object expressions when value
dbrattli 9ca3054
Added reflection tests and fixes
dbrattli d3b0420
Remove unused files
dbrattli db9e196
Remove Babel2Python
dbrattli c1c8dab
Remove obsolete files
dbrattli a7988cf
Revert quicktest
dbrattli 3f1c236
Revert changes to build.fsx
dbrattli c42c106
Remove unused file
dbrattli 5ff46d3
Remove unused files
dbrattli 1dc225e
Use global .gitignore
dbrattli dfbe385
Remove vscode settings
dbrattli a1095de
Fix warnings
dbrattli b33d270
Fix reflection tests
dbrattli 9f40850
Fix union field index
dbrattli c3f8b5e
Rename JS to Python
dbrattli b81c02b
Cleanup Fable.Core.PY.fs
dbrattli 38161ac
Remove `callable`
dbrattli 2eb5a52
Remove callable from Native.fs
dbrattli 72c972b
Enable disabled tests
dbrattli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ type Verbosity = | |
type Language = | ||
| JavaScript | ||
| TypeScript | ||
| Python | ||
| Php | ||
|
||
type CompilerOptions = | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.