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

Fix #15514 in Parser #15524

Merged
merged 2 commits into from
Jun 27, 2022
Merged

Fix #15514 in Parser #15524

merged 2 commits into from
Jun 27, 2022

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 25, 2022

There was a missing set of parentheses in parser which caused a lookahead
from INTERPOLATIONID, which should be illegal, since the lookahead then
might set the next TokenData which is subsequently overwritten by reset.

We now demand that lookahead cannot be called if the current token is
a INTERPOLATIONID.

There were two variants of lookahead in the Scanner, which only differed
in camelCase or not. Rename one topeekAhead to make the code clearer.

Alternative for #15518 and #15519.

There was a missing set of parentheses in parser which caused a lookahead
from INTERPOLATIONID, which should be illegal, since the lookahead then
migth set the next TokenData which is subsequently overwritten by reset.

We now demand that lookahead cannot be called if the current token is
a INTERPOLATIONID.

There were two many variants `lookahead` in the Scanner, which only differered
in camelCase or not. Rename one to`peekAhead` to make the code clearer.
@odersky
Copy link
Contributor Author

odersky commented Jun 25, 2022

This was really hard to diagnose. I was stumped until I looked more closely at @som-snytt's first PR #15518, which pointed at the problem.

@som-snytt
Copy link
Contributor

Lgtm. I looked at that line a couple of times. I'm on the phone app for the first time and not sure I will see how to approve. I tried not to think about parser during our visit to Grove of Titans redwoods.

@odersky
Copy link
Contributor Author

odersky commented Jun 27, 2022

@som-snytt Thanks! I am going to merge now.

@odersky odersky merged commit 16ded76 into scala:main Jun 27, 2022
@odersky odersky deleted the fix-15514-in-parser branch June 27, 2022 08:39
@Kordyjan Kordyjan added this to the 3.2.1 milestone Aug 1, 2023
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.

String interpolation followed by a dot is missing string literals
3 participants