Very cool!
I was going to write something similar to this, so I took some time to mess around with this.
Here are two minor bugs I’ve found that breaks the system:
- There’s a uncommon/unknown method of writing strings or comments
exampleString = [==[hey this is a string]==]
example2String = [=========[hey this is also a string]=========]
--[========================================================================[
you can put any number of equal signs,
so long as it's the same amount on the top and bottom.
all of this counts as a comment
]========================================================================]
- This is technically valid lua, but it breaks LuaRaiter
function
--[[hey]]anotherAlsoWrittenFunny()
end
Overall, code is not commonly structured in the ways shown above, so these are very minor issues.
I appreciate you making this open source!
If you want an easier (though probably unnecessarily more computationally expensive) method of solving the issues listed above, I recommend using a Lexer module, like the one originally made by sleitnick and improved by boatbomber. (That’s what I might do for my own project, since I don’t want to bother too much with string manipulation)