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

Handle method/mixin scope uniformly #233

Merged
merged 1 commit into from
Mar 20, 2018
Merged

Handle method/mixin scope uniformly #233

merged 1 commit into from
Mar 20, 2018

Conversation

smarr
Copy link
Owner

@smarr smarr commented Mar 12, 2018

Until now, we kept mixin and method scopes separately (introduced with #112), which does not directly represent the lexical structure and can cause confusion.

With this change, scope is managed as a single chain outwards (solving #182), with methods and mixins on the same chain.

This change applies to LexicalScope classes as well as to the Builder classes.

  • add ScopeBuilder superclass for MixinBuilder and MethodBuilder
  • correctly determine whether scopes are immutable also for methods
  • added Local.isMutable()
  • InliningVisitor, handle case that there are no variables

@Richard-Roberts please test and review this carefully!
Locally, all tests seem to pass, but I expect that your Grace code is more complex, and could hit other issues

@smarr smarr added the enhancement Improves the implementation with something noteworthy label Mar 12, 2018
@smarr smarr added this to the v0.6.0 - Black Diamonds milestone Mar 12, 2018
@coveralls
Copy link

coveralls commented Mar 12, 2018

Coverage Status

Coverage remained the same at 77.312% when pulling 8245c3a on unify-scope into 1d86f8c on dev.

@ghost
Copy link

ghost commented Mar 12, 2018

At first glance, it looks great - something that I can get my head around more easily. I can't get to this now sorry, but will do it on Wednesday.

Until now, we kept mixin and method scopes separately, which does not directly represent the lexical structure and can cause confusion.

With this change, scope is managed as a single chain outwards, with methods and mixins on the same chain.

This change applies to LexicalScope classes as well as to the Builder classes.

- add ScopeBuilder superclass for MixinBuilder and MethodBuilder
- correctly determine whether scopes are immutable also for methods
- added Local.isMutable()
- InliningVisitor, handle case that there are no variables

Signed-off-by: Stefan Marr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the implementation with something noteworthy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants