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

Improve faulty scanning on comments #12892

Merged

Conversation

privat
Copy link
Contributor

@privat privat commented Mar 2, 2023

Comment was the only (remaining) scanned token to possibly signal a syntax error notification (and possibly launch a recovery editor in the UI) instead of producing an error token. This PR change that.

The issue was that comments are stripped from the scanner flow, but AFTER the next token is scanned (so that we can attach the comments on the token returned by next).
The proposal is if one of the comment is a bad comment (the only current case is an unterminated comment), we have to rewind the stream position (and the scanned state) just before the faulty token so that the next next will scan and return this faulty token.
The proposal is if one of the comment is a bad comment (the only current case is an unterminated comment), we just remember it, so it will be the next token (returned by next).

Note that EFFormatter have some issues with comments, so tests are let as it but will catch on future improvements.

@privat
Copy link
Contributor Author

privat commented Mar 2, 2023

I did not like the strategy used, so I couldn't sleep, so I changed it... now to bed!

@MarcusDenker
Copy link
Member

@MarcusDenker MarcusDenker merged commit 73b361c into pharo-project:Pharo11 Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants