Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler: overriding substitutions #1721

Open
alixander opened this issue Nov 10, 2023 · 1 comment · May be fixed by #1765
Open

compiler: overriding substitutions #1721

alixander opened this issue Nov 10, 2023 · 1 comment · May be fixed by #1765
Assignees

Comments

@alixander
Copy link
Collaborator

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.

Screen Shot 2023-11-10 at 3 06 23 PM

One simple solution is to do two passes. The first pass to build up the variable stack and the second to make the subs.

@alixander alixander linked a pull request Dec 8, 2023 that will close this issue
@alixander
Copy link
Collaborator Author

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.

@alixander alixander self-assigned this Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant