Skip to content

Accept soft modifiers separated by blank lines #14959

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

Merged
merged 2 commits into from
Apr 20, 2022

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 18, 2022

This was handled inconsistently before. An identifier could be classified as
a soft modifier even if followed by newlines but then the modifier parsing code
would not skip the NEWLINES token. Now it does skip.

Fixes #11712

odersky added 2 commits April 18, 2022 10:29
This was handled inconsistently before. An identifier could be classified as
a soft modifier even if followed by newlines but then the modifier parsing code
would not skip the NEWLINES token. Now it does skip.
```
class Expr private

object
```
now means the `private` modifier is for the following `object`, not the (invisible) constructor of `Expr`.
@odersky odersky requested a review from tgodzik April 18, 2022 11:23
@odersky
Copy link
Contributor Author

odersky commented Apr 18, 2022

@tgodzik I believe scala-meta needs a similar fix.

@tgodzik
Copy link
Contributor

tgodzik commented Apr 19, 2022

@tgodzik I believe scala-meta needs a similar fix.

Seems we have an issue with soft keywords and multiple newlines, fixing it here scalameta/scalameta#2732

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

LGTM!

@odersky odersky merged commit 119e3d7 into scala:main Apr 20, 2022
@odersky odersky deleted the fix-11712 branch April 20, 2022 17:32
@Kordyjan Kordyjan added this to the 3.2.0 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.

non-informative error message for a transparent soft keyword with multiple new lines after it
3 participants