Move from globally-unique ScopedId
to function-local IDs
#50
Labels
area: AST
Issues which affect AST code
area: check
Code validation
area: identify
The "identify pass" - the ScopedId De Brujin index, or "ensure name exists in scope"
change: expansion
A change which includes new features, improvements, or APIs
priority: low
Consider higher priority issues first
Edit: See my comment below.
This is a tracking issue regarding the use of
ScopedId
s in the AST (currently in the typeck branch). These de Bruijn indices currently have some properties that I try to uphold but don't depend on; the structure of aScopedId
could be useful in the future (if the AST design is upheld.When creating
ScopedId
s on variables:default()
of[0]
is never assigned (this is depended upon).visit_unit
are numbered[0, 0] .. [0, n]
.visit_unit
is calledk
times then items in unitk
are numbered[k, 0] .. [k, n]
.k
parameters of function[0, n]
are numbered[0, n, 0] .. [0, n, k]
.[0, n]
is[0, n, 0, 0]
k
th top-level variable defined in a function[0, n]
is[0, n, 0, k]
.When creating
ScopedIds
on types:()
,bool
, andfloat
are[1]
,[2]
, and[3]
respectively.ScopedId
s, i.e.[0, n]
Additional things we could do:
[ ] Dump function parameters into the top level scope (seeidentify/names/item_identifier.rs
These changes are all in the typeck branch. I'll revisit this issue after that is merged in.
The text was updated successfully, but these errors were encountered: