Still pretty horribly broken. I was generating dispacements
backwards, failing to emit stuff like the beginning of
loops, the logic for `if` jumps was backwards, etc.
I was also completely forgetting to increment file_here
for appends. I don't remember what all I did; check the diff.
Next stages are to wire it into the parser so I can test it,
to implement operator precedence so exprs actually exist,
and then implement operators and builtins until I can
start writing basic programs.
Also no top-level declarations or operator precedence.
The syntax is LL(1). LL syntax seems necessary because
our codegen requires emitting certain code (e.g. entering control)
prior to any codegen inside that context, whereas something like
LR would presumably parse the inner expression before recognizing
the control structure. There may be some way to work around this;
I don't know, I'm not a parsing expert.
Certain parts of the syntax are wonky, e.g. juxtaposition as
function application means a missing semicolon can give confusing
results. I suspect indentation-sensitive syntax would work
more nicely, and intend to implement it some time in the future.
Now we always use the stack instead of keeping a TOS register.
This is very inefficient, but I'll worry about register
allocation later.
The new block model is inspired by x86's `enter` and `leave`
instructions. I intend to support nested procedures at some point
in the future.