Lua 5.0 support#1263
Merged
Perryvw merged 77 commits intoTypeScriptToLua:masterfrom Sep 3, 2022
YoRyan:lua5.0
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR is a first attempt at introducing support for Lua 5.0, a version that some older games remain stuck on. It adds a 5.0 LuaTarget that triggers the appropriate syntax for variadic arguments and length-checking and modulo operations.
Lua 5.0, while mostly similar to 5.1, is not forwards-compatible; it is not possible to write a transpiler that is simultaneously compatible with both 5.0 and 5.1 syntax. Hence, if you choose to accept support for 5.0, you might also need to rename the "Universal" target to something more descriptive, like "5.1+".
Next steps: Adding tests, adding the appropriate type annotations for the 5.0 standard library to the lua-types package, and updating lualib to be 5.0-compatible.