Skip to content

Skip empty statements around end markers #11602

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 1 commit into from
Mar 5, 2021
Merged

Skip empty statements around end markers #11602

merged 1 commit into from
Mar 5, 2021

Conversation

Kordyjan
Copy link
Contributor

@Kordyjan Kordyjan commented Mar 4, 2021

Fixes #11581

When we encounter two end markers one after another we parse it as an end marker, then one or more empty statements then another end marker. Since empty statements are not added to the list of opened statements, the last not empty statement still can be closed with an end marker, regardless if it was closed before. This PR adds skipping empty statements around end markers. That way, every end marker after the first one is treated as a new statement, which will in all sane cases result in compilation error.

This PR is not touching the question if an end marker should be allowed after the right brace, as it seems to be controversial.

@nicolasstucki nicolasstucki merged commit 89217ca into scala:master Mar 5, 2021
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 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.

Redundant end markers
2 participants