Comment by mingodad
1 year ago
I've made changes to the Lua/LuaJIT lexer/Parser to have a C like syntax and a program to convert Lua syntax to LJS syntax you can see it in the repositories shown bellow, the C api and language semantics remain the same.
- https://github.com/mingodad/ljs
- https://github.com/mingodad/ljs-5.4
- https://github.com/mingodad/ljs-5.1
- https://github.com/mingodad/ljsjit
- https://github.com/mingodad/raptorjit-ljs
- https://github.com/mingodad/CorsixTH-ljs
Cool! Did you fix new variables being global by default? What kind of checking is applied to the type annotations like `: string`?
No changes to "global by default" and no checking are made to type annotations. The idea was to be able to convert any existing Lua code automatically and get it working as before like I did with some non trivial projects like:
- https://github.com/mingodad/CorsixTH-ljs - https://github.com/mingodad/ZeroBraneStudioLJS
But I implemented a warning/error for variable shadowing.