Hello everyone! Below you will find a semi-working parser and interpreter for the lua programming language.
However, it is far from finished and very crude.
Some drawbacks of it include:
Loops aren't implemented yet.
Extremely buggy and prone to infinite loops.
Many aspects of lua aren't implemented.
Strings aren't even unique yet so they are basically treated as identifiers, which means no important keywords such as if, then, function allowed inside strings without decorating them with say, an underscore.
The good parts:
Real tokenizer and parser made from scratch, not just reading a file line by line and using regular expressions or replace!
It can run recursive factorial.
And finally, I shall honor your eyes with the code.
https://repl.it/@CSharpIsGud/LuaInterpreter2
Top comments (0)