Lua 5.0 support#1263
Conversation
|
I guess for this PR it is not yet required. But in the future we will need to add 5.0 to our WASM bindings, that way we can run tests for 5.0 properly. (TypeScriptToLua/lua-wasm-bindings#1) |
Perryvw
left a comment
There was a problem hiding this comment.
Changes look good to me, just had some comments related to error messages and tests.
This reverts commit fac16d2.
|
I've submitted the type declarations with pull request TypeScriptToLua/lua-types#59. |
|
Okay, so here's a status update on this porting effort:
Still to do:
|
|
I managed to achieve different source files for different Lua targets with f390622! I used tsconfig.json's As a bonus, we can now enable type checking of lualib against the Lua 5.0 types. This will work out-of-the-box once TypeScriptToLua/lua-types#75 is merged. |
…reloading the entire bundle" This reverts commit 8d9ce98.
|
I've addressed all feedback and believe this is ready for a re-review. You need TypeScriptToLua/lua-types#75 and TypeScriptToLua/lua-wasm-bindings#5 to get the tests to pass. |
…o the universal target
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.