You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The namespace and symbol management in the current parser is very ad-hoc. We have multiple symbols we need to resolve, each it their own ad-hoc namespaces:
Builtins
Modules/module symbols
User vars/consts
User functions
Additional built-in functions
We should extract all of these into a single place for managing namespaces. As each of these comes along with some "baggage" (ie: modules have a module pointer, vars have a slot index, etc), we need to stash some context information alongside the symbol name.
In addition to simplifying symbol lookup:
we can also implement block scoping for variables, allowing users to define var and const wherever they find it most appropriate to do so, rather than at the top of the function.
we can more easily run the parser twice over the source code and pick up function definitions later in the file as forward references
The text was updated successfully, but these errors were encountered:
The namespace and symbol management in the current parser is very ad-hoc. We have multiple symbols we need to resolve, each it their own ad-hoc namespaces:
We should extract all of these into a single place for managing namespaces. As each of these comes along with some "baggage" (ie: modules have a module pointer, vars have a slot index, etc), we need to stash some context information alongside the symbol name.
In addition to simplifying symbol lookup:
var
andconst
wherever they find it most appropriate to do so, rather than at the top of the function.The text was updated successfully, but these errors were encountered: