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

Support scopes properly. #124

Merged
merged 2 commits into from
Feb 14, 2020
Merged

Support scopes properly. #124

merged 2 commits into from
Feb 14, 2020

Conversation

skx
Copy link
Owner

@skx skx commented Feb 14, 2020

Currently the variables set in our foreach handler live forever, potentially overwriting global variables with the same names.

This pull-request will close #123 by handling scope for this case correctly:

  • The variable(s) set in the foreach statement will only live for the
    duration of their enclosing block.
    • This means they'll be unavailable when the block is terminated.
    • And this will work for (deeply) nested loop-iterations.

Currently the variables set in our `foreach` handler live
forever, potentially overwriting global variables with the
same names.

This pull-request will close #123 by handling scope for this
case correctly:

* The variable(s) set in the foreach statement will only live for the
duration of their enclosing block.
  * This means they'll be unavailable when the block is terminated.
  * And this will work for (deeply) nested loop-iterations.
This is a combination of over-engineered and heuristic-based.

Probably works.
@skx skx merged commit 4ec8e20 into master Feb 14, 2020
@skx skx deleted the 123-scopes branch February 14, 2020 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We need to handle scoped variables
1 participant