-
-
Notifications
You must be signed in to change notification settings - Fork 184
Lua 5.0 support #1263
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
Lua 5.0 support #1263
Changes from all commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
893bfaa
feat: add flag for lua 5.0 target
YoRyan ceb7e96
feat(5.0): implement spread arguments
YoRyan 4d17bb5
fix(5.0): in general, cases that apply to 5.1 should also apply to 5.0
YoRyan fdb322c
style: run prettier
YoRyan 14f9421
test(5.0): share the expected results of the obvious cases with 5.1
YoRyan ff729e3
feat(5.0): work around the missing '#' and '%' operators
YoRyan 635d271
fix: log the correct lua version for unsupported features
YoRyan 2836859
style: condense spread table if branch
YoRyan fac16d2
test: add a special case for modulo for 5.0
YoRyan bb83e32
style: fix indentation for test function snippet
YoRyan 927dba6
feat(5.0): implement spread element correctly
YoRyan 64e5f6d
fix: report correct lua version in bitops diagnostic message
YoRyan a5f39f6
test: refactor spread tests to accomodate 5.0
YoRyan 2399554
Revert "test: add a special case for modulo for 5.0"
YoRyan 555e2f8
test: test basic numeric expressions against all versions
YoRyan afdc088
style: run prettier
YoRyan 3a64a33
Merge branch 'TypeScriptToLua:master' into lua5.0
YoRyan 85db0cb
refactor: use the convenience function to make an unpack call
YoRyan 852febd
style(lualib): use @noselfinfile for the modulo polyfill
YoRyan 3446474
Merge branch 'master' into lua5.0
YoRyan 1f60fa3
fix: make bundling compatible with lua 5.0
YoRyan 56727c9
fix(5.0): optimized single element array push for 5.0
YoRyan 110e379
fix(5.0): fix constructor w/ instance fields for 5.0
YoRyan 3f64c13
Merge branch 'master' into lua5.0
YoRyan bc89dce
fix(lualib): count varargs correctly with lua 5.0
YoRyan 36324fb
fix(lualib): tracebacks don't support threads with lua 5.0
YoRyan 18d3c7a
fix(lualib): work around missing math.modf() in lua 5.0
YoRyan f57f75b
fix(lualib): work around missing string.match() in lua 5.0
YoRyan 3496d67
fix(lualib): detect lua 5.0 minor versions correctly
YoRyan fe45a47
refactor(lualib): lua 5.0 check can be a constant instead of a function
YoRyan 937b776
Merge branch 'master' into lua5.0
YoRyan 5eca07c
Merge branch 'lua5.0' into lua5.0-lualib
YoRyan da5fcb5
fix(5.0): get json test library to load
YoRyan b410d08
style: rename 5.0 json file
YoRyan 2956058
style: use a better definition of infinity
YoRyan f0976df
feat(5.0): don't transform infinity to math.huge, which doesn't exist…
YoRyan 36b93ae
Merge branch 'master' into lua5.0
YoRyan 54f115c
Merge branch 'lua5.0-lualib' into lua5.0
YoRyan cc427a2
chore: bump lua-types version
YoRyan a1abb9e
feat: build another copy of lualib for 5.0
YoRyan 41a219a
style: run prettier
YoRyan 892b2cf
fix: small issues discovered in testing
YoRyan e187193
chore: bump lua-wasm-bindings version
YoRyan ccae8fd
fix(lualib): select() call was not using vararg optimization, breakin…
YoRyan 8d9ce98
test: use inline lualib imports to get around problems with preloadin…
YoRyan d656050
test: remove old snapshots
YoRyan 581fb52
fix: json files can't contain comments
YoRyan ab49bae
Revert "fix: json files can't contain comments"
YoRyan 38b0288
test: exclude lualib-lua50 from coverage
YoRyan ced3532
style: move 5.0 tsconfig.json to existing lualib dir
YoRyan 28cc8cd
style: refactor lualib resolution into common function
YoRyan d1bf66a
style: factor out table length transpilation into common function
YoRyan f2563cc
style: format 5.0 and non-5.0 require shims
YoRyan 4ab5891
test: remove obsolete lua 5.0 arg test
YoRyan fdcea36
refactor(lualib): use builtins for the 5.0 branches instead of a vers…
YoRyan f390622
refactor(lualib): move 5.0-specific to its own directory
YoRyan c18a1fc
chore: add tsconfig to eslint
YoRyan e5e9723
refactor(lualib): reorganize dist/lualib directories to better suppor…
YoRyan e0d6206
fix(lualib): cache should account for multiple possible versions
YoRyan 42f6de0
Revert "test: use inline lualib imports to get around problems with p…
YoRyan 9b3a223
chore: adjust jest and npm configs for new lualib structure
YoRyan 0953f26
refactor: cache lualib by file path so the universal target isn't cac…
YoRyan 2dc07a8
chore: bump lua-types
YoRyan 4715540
refactor: deduplicate require boilerplate
YoRyan 3bc745c
refactor: simplify universal definition of TS_Match
YoRyan 04b1a27
Merge branch 'master' into lua5.0
YoRyan 236bd77
style: rename TS_Modulo -> TS_Modulo50
YoRyan 9820e42
refactor(lualib): use unpack helper to avoid code duplication in Gene…
YoRyan 5814859
refactor(lualib): eliminate duplication in SourceMapTraceBack.ts
YoRyan 96c6f48
chore(lualib): fix comment in CountVarargs.ts
YoRyan cd9b219
refactor(lualib): eliminate duplication in Error.ts
YoRyan 023b5e4
fix(lualib): modules info should be cached per-target
YoRyan 9137683
refactor(lualib): eliminate duplication in NumbertToString.ts
YoRyan 4713b69
refactor(lualib): modules info can also be cached by file path to avo…
YoRyan 92a36a2
style: for locating lualib features, it makes more sense to default t…
YoRyan d7014a4
style: delete unnecessary noselfinfile
YoRyan 7d90ef7
chore: add 5.0 target to tsconfig schema
YoRyan 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** @noSelfInFile */ | ||
|
|
||
| export function __TS__CountVarargs<T>(...args: T[]): number { | ||
| // select() is not available in Lua 5.0. In this version, the arg table | ||
| // includes trailing nils. | ||
| return args.length; | ||
| } |
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.