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

Introduce new mdoc:nest modifier for redefining variables. #251

Merged
merged 3 commits into from
Dec 26, 2019

Conversation

olafurpg
Copy link
Member

See https://underscore.io/blog/posts/2019/12/12/tut-to-mdoc.html for a
motivation.

Previously, the best workaround for redefining the same variable name
was to use reset, which was not a great workaround because it clears
all the existing statements in scope. Now, uses can use the nest
modifier to introduce a new scope that allows redefining the same
variable names while still accessing existing variables in scope.

Olafur Pall Geirsson added 3 commits December 25, 2019 11:54
See https://underscore.io/blog/posts/2019/12/12/tut-to-mdoc.html for a
motivation.

Previously, the best workaround for redefining the same variable name
was to use `reset`, which was not a great workaround because it clears
all the existing statements in scope. Now, uses can use the `nest`
modifier to introduce a new scope that allows redefining the same
variable names while still accessing existing variables in scope.
* Fix bug when used in combination with reset
* Report error when using `nest:reset` since it's redundant
* Add more test cases stressing nest+reset combinations
@olafurpg olafurpg merged commit e642727 into scalameta:master Dec 26, 2019
@olafurpg olafurpg deleted the locally branch December 26, 2019 22:53
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.

1 participant