Open alixander opened 7 months ago
nvm, vars has to be reimplemented.
Consider this:
vars: {
x: {
label: var-set
}
}
a: ${x}
a.label: self-set
b.label: self-set
b: ${x}
You just can't know after map compilation whether the substitution came before or after.
We just compile vars in main map compilation. Every time we pop out of a map, we should pop stack of vars.
This should've overridden the label set by the substitution. Since the compiler has to compile the current map to get the variables, we compile substitutions only after.
One simple solution is to do two passes. The first pass to build up the variable stack and the second to make the subs.