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

RubyParser: emit ASSIGNMENT_LIKE_METHOD_IDENTIFIERS #3296

Merged
merged 3 commits into from
Jul 28, 2023

Conversation

xavierpinho
Copy link
Contributor

@xavierpinho xavierpinho commented Jul 27, 2023

Previously, so-called assignment-like method identifiers (e.g. foo2= in def foo2=(x) ... end) were being lexed as two separate tokens (LOCAL_VARIABLE_IDENTIFIER and EQ) and handled together in a parser rule. However, with the introduction of so-called endless methods, this separation could lead to wrong parse trees, as witnessed by #3270 .

To resolve this ambiguity, we shall now gobble up the EQ token as part of the method name, emitting an ASSIGNMENT_LIKE_METHOD_IDENTIFIER token instead.

Closes #3270

@xavierpinho xavierpinho merged commit 76b67f8 into master Jul 28, 2023
5 checks passed
@xavierpinho xavierpinho deleted the xavierp/ruby-assignment-like-method-token branch July 28, 2023 13:06
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.

[Bug] RubyParser: Incorrect hierarchy with the methodDefinition production
2 participants