r/lua • u/RodionGork • Aug 27 '25
Lua syntax minor amends - need help in testing
Hi Friends! Yesterday I told about my "exercise" of slightly amending Lua parser so that it will work, particularly, with compound assignments. Today I found a way (hopefully) to make it work for any complex expressions for L-values. And would be glad if you can spare 10-15 minutes to test it and perhaps invent some whimsical expressions to break it.
I don't mean this is ingenious amend which should be merged to official Lua of course :) it is more like exercise for me to study the source code of Lua.
Here is the repo: https://github.com/rodiongork/lua-plus - it could be seen that change is really small (110 lines, half of them in readme) - in the latest commit.
2
u/Cristian_tallica Aug 27 '25
Great work! I've tested it. Can you be added on luajit source? Personally, i write web apps using luajit running over openresty
2
u/didntplaymysummercar Aug 27 '25
That Lua is a small easy to read and work with C codebase is one of things I love about it. Way easier and smaller than CPython, but it's still a "real" thing, not just some demo/toy/poc VM.
I sometimes think about forking 5.1 for my own use, but keeping syntax and behavior same to keep compatibility with JIT and stock 5.1, but only thing I did so far is pick commit from 5.2 that reduces memory usage by 8 bytes.
Maybe the two (or even three, != and ! and compounds) changes could be split into own commits, if someone wanted to look at them in isolation?