I did some more refactoring and I got rid of all the dependency injections. The source code now conforms fully with to Python's import system, which I hope will improve readability for those who may be interested in compiler technology in general.
I also found a way to implement constant folding in an elegant way. It doesn't yet take into account local variables but hopefully I'll be able to do that next. The immediate consequence is that:
Code: Select all
define constant (10, base) global variable (base + 1, tick) global variable (base + 2, interacted) ...
Keep in mind that my version of the compiler is byte-code compatible with the engine but unlike the "physpeak" version which is in the GitHub, my version only supports a subset of the HamsterSpeak language which is fully functional but more similar to C.
Because of the renaming/refactoring, new download link is:
https://sourceforge.net/projects/snes9l ... z/download
Any future development by me will be merged there. Cheers to all.