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

Check for a semicolon or a newline after the inheritance operator #1558

Merged

Conversation

haldun
Copy link
Collaborator

@haldun haldun commented Sep 20, 2023

Closes #1544

src/yarp.c Outdated
@@ -12254,7 +12254,12 @@ parse_expression_prefix(yp_parser_t *parser, yp_binding_power_t binding_power) {
}

yp_parser_scope_push(parser, true);
accept2(parser, YP_TOKEN_NEWLINE, YP_TOKEN_SEMICOLON);
if ((inheritance_operator.type != YP_TOKEN_NOT_PROVIDED) && !accept2(parser, YP_TOKEN_NEWLINE, YP_TOKEN_SEMICOLON)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to leverage expect2 here

@kddnewton
Copy link
Collaborator

@haldun can you rebase off main?

@kddnewton
Copy link
Collaborator

@haldun instead of merging in main could you rebase? (Just trying to avoid merging in a bunch of merge commits)

@haldun haldun force-pushed the haldun/check-semicolon-after-inheritance-op branch 2 times, most recently from e50ad9f to 135ec74 Compare September 23, 2023 07:00
@haldun
Copy link
Collaborator Author

haldun commented Sep 23, 2023

Rebased in 135ec74

@haldun haldun force-pushed the haldun/check-semicolon-after-inheritance-op branch 3 times, most recently from f6817e9 to 4d66066 Compare September 27, 2023 18:24
@kddnewton
Copy link
Collaborator

Oh man sorry @haldun another rebase necessary...

@haldun haldun force-pushed the haldun/check-semicolon-after-inheritance-op branch from 4d66066 to 0326ba6 Compare September 28, 2023 13:27
@haldun
Copy link
Collaborator Author

haldun commented Sep 28, 2023

rebased in 0326ba6

@kddnewton kddnewton merged commit dd3a2c6 into ruby:main Sep 28, 2023
46 checks passed
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.

Ruby rejects class X < Y end but YARP accepts it
2 participants