foolang icon indicating copy to clipboard operation
foolang copied to clipboard

AST should not resolve variables to frameOffsets and index

Open nikodemus opened this issue 3 years ago • 0 comments

  • AST contains variables which have index in their frame. This is problematic because deleting a variables will require renumbering the remaining ones.

  • AST contains refs to variables which specify the frame-offset of the variable. This is problematic because then new frames cannot be added in transformations (eg. transforming dynamic bind into two blocks and #finally:.)

Plan:

  • Have AST variables link to the defining environment, which links back to the variables. Adding or deleting variables can then be handled. Variable index can be adjusted if variables are added or deleted, environments merged, etc.

  • Have AST variable refs link to their containing environment and the variable. Adding or deleting intermediate environments can then be handled as long as they're linked both to their parents and children. To find the frame-offset check how many environments are between the containing environment and the defining environment.

nikodemus avatar Oct 10 '20 08:10 nikodemus