v21.12.8
Store scope associations on nodes via a ScopeCarrier trait (#1729)
Bugs fixed:
- a labelled loop failed to compile with an internal error: every scoped
pass entered the labelled statement as a scope, but no pass ever
associated one - break and continue ignored their label at IL generation and always
targeted the innermost loop; they now branch to the named loop, and an
unmatched label is a compile error
Technical:
- scope associations move from a SYMBOL_TABLE hash map onto the nodes
themselves: scope-introducing node types implement a new ScopeCarrier
trait, and associate/enter/leave take the trait type, so entering a
scope on a non-carrying node is a compile error instead of a runtime
lookup miss - the namespace scope association moves from the namespace's name
identifier onto the NAMESPACE node - drops two dictionary lookups per scope node per pass and the per-build
scope map allocation
Co-authored-by: ghul-coder[bot] <286450068+ghul-coder[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 noreply@anthropic.com