Functions are compiled in the most naiive way right now. I want to fix
up how scope lookups are done before it becomes too much to update.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Code is compiled into a vm:📦:Package which contains the
executable code, the constants, and the local name mappings.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Variables were previously named "Local"s because they described a
local variable - however, this is kind of a misnomer because it
handles globals as well. This has been changed pretty much everywhere
when appropriate (hopefully).
* Renamed obj/names.rs to obj/reserved.rs, freeing up the "names" module
for the new Names handle
* Renamed obj/locals.rs to obj/names.rs, see above
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
I'm able to compile some basic expressions into instructions using the
`not` binary. Big first step, now we need to introduce branches and
loops to the syntax.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Basic are a more linear way of representing code. Thunks beget basic
blocks, which beget vectors of instructions.
* Basic blocks are also being flattened into a vector of instructions
(hopefully, no tests done yet)
* OH yeah locals can be collected too (but currently are not being
collected in the compiler, that should come soon)
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Add lexer and parser using lrpar crate
* AST is added and constructed via lexer and parser
* Command line program `not` will read a file and parse it
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>