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

Raise ParseError on missing end for else statement #167

Conversation

vinistock
Copy link
Contributor

In on_else, the index of the last end or ensure token could potentially be nil on some cases, which led to trying to dereference the tokens array with nil - resulting in no implicit conversion of nil into integer.

This PR just raises a ParseError instead, pointing to the else token.

@kddnewton kddnewton merged commit 3e07be7 into ruby-syntax-tree:main Oct 11, 2022
@vinistock vinistock deleted the vs/raise_parse_error_on_else_missing_end branch October 11, 2022 18:25
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.

2 participants