ts-owner / tommy-script

A programming language
GNU General Public License v3.0
5 stars 0 forks source link

Rewrite interpreter #6

Closed Shamrock-Frost closed 6 years ago

tommy-mor commented 6 years ago

also, they way you have implemented return is much better than my exception way, but it still feels hacky. Don't have any ideas on how to make it better, but yeah

Shamrock-Frost commented 6 years ago

Yeah for return I just went off of the interpreter we used in my cs class. Idk though

tommy-mor commented 6 years ago

for the return thing, craftinginterpreters.com (section 10.5) uses exceptions in it's most basic interpreter, and I think it's valid at least as a loose reference. I thought your method was a hack you came up with (no offense) but if it came from a class then it's prob be the best way. Maybe further research but it's good for now.