skeezix
Internal Development
I meant to look into putting the Scoping rules into the "AST" (the element tree); as is, when you do a GOSUB, that handler does an enter- and exit-scope around the 'run element' business. Should be fine, but at the same time, the 'parsing/compiling to AST' phase could just insert an element for 'enter scope' and such. I thik theres implications there for if doing arbitrary goto and gosub about where it would land.
Theres also of course Closures and other fun things you can do with scopes, that my _very_ rudimentary scoping rules wouldn't handle. So far, a scope is just a nested symbol table.. nothing more. Its not really what it should be, but it should do the job for a toy language.
I also need to clean it up to make the interpreter and lexer into structs, so that if someone wanted, they could instantiate several interps at once. It uses a half dozen globals for storing state, so a cleaning would be nice. But it didnt' seem a priority, since its a toy, and there shouldn't likely be a need to spawn multiple instances simultaneously.
Theres also of course Closures and other fun things you can do with scopes, that my _very_ rudimentary scoping rules wouldn't handle. So far, a scope is just a nested symbol table.. nothing more. Its not really what it should be, but it should do the job for a toy language.
I also need to clean it up to make the interpreter and lexer into structs, so that if someone wanted, they could instantiate several interps at once. It uses a half dozen globals for storing state, so a cleaning would be nice. But it didnt' seem a priority, since its a toy, and there shouldn't likely be a need to spawn multiple instances simultaneously.