-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
redo and next should raise a SyntaxError in methods #3058
Comments
@eregon We do not have parent links between node in AST so I think this is more easily done after parsing but I don't want the parser to walk the tree after making it to look for this condition (it would slow startup to re-walk each tree). This means both Truffle and IR should detect this during the assembling their respective intermediate forms. This is a little duplication but can be done when naturally walking the tree to build our IRs. |
@eregon I guess we could do a subtree visit on DefnNode creation but it still feels like an extra traversal of part of the tree. |
@enebo Sounds reasonable, I actually implemented it in Truffle translator. |
@eregon At the time we are creating the node we have no up-pointing references to higher scope types (e.g. begin, def{sn}, module,class, etc...) so we need to walk from scopes down to look for the redo/next. We create staticScopes but they have no back references so that is not usable either. |
See dcb41d0 and the 2 previous commits.
Should it be done in the parser? (and is it reasonable?)
It seems MRI does it slightly later as
-c
or Ripper will not catch it for instance.The text was updated successfully, but these errors were encountered: