Skip to content

Improve skipping on syntax errors #11636

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 8, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 7, 2021

Simplify and improve the algorithm used for skipping tokens when a syntax
error is encountered. The new algorithm is based on the region stack maintained
in Scanner instead of maintaining separate counters for open parentheses. This
improves the precision of skipping in general, since there's is no chance that
the two datastructures get out of sync. It seems that way we produce overall
fewer follow-on errors after a syntax error.

Simplify and improve the algorithm used for skipping tokens when a syntax
error is encountered. The new algorithm is based on the region stack maintained
in Scanner instead of maintaining separate counters for open parentheses. This
improves the precision of skipping in general, since there's is no chance that
the two datastructures get out of sync. It seems overall we produce fewer follow
on error after a syntax error that way.
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Nice simplification 🎉

@liufengyun liufengyun merged commit b1c5f0b into scala:master Mar 8, 2021
@liufengyun liufengyun deleted the change-skipping branch March 8, 2021 12:49
@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.

3 participants