HuoLanguage / huo

interpreted language written in C
MIT License
212 stars 21 forks source link

Harden parser #27

Closed TheLoneWolfling closed 8 years ago

TheLoneWolfling commented 8 years ago

This adds a bunch of sanity checks to the parser. Still nowhere near robust, but it's (slowly) getting there. Next step: change arrays to dynamic allocation.

TheLoneWolfling commented 8 years ago

My apologies for the lack of informative commit messages.

incrediblesound commented 8 years ago

Cool, I am currently improving the execute function so that is has a map of local lets and a map of global lets. This simplifies function execution and is more performant (no more iterating down an AST to replace variable with values) and decouples let bindings inside functions from those in the global scope. I will finish that improvement before I merge this in because there may be some merge conflicts.

incrediblesound commented 8 years ago

OK I merged this branch. This interpreter is a lot closer to being a stable program now! There was one part in your changes that caused some errors though: lines 54-57 in build_array.c. I commented them out for now but you might want to take another look at those lines.

TheLoneWolfling commented 8 years ago

I shall do so, thank you.