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 tokenizer positions when multiple newlines follow eachother #270

Merged
merged 3 commits into from
Feb 25, 2023

Conversation

JohnnyMorganz
Copy link
Collaborator

There is a bug in read_position when multiple newlines follow each other, which manifests into the errors seen in https://github.com/evaera/moonwave/actions/runs/3990359990/jobs/6843912815

This is because the line number is not bumped for consecutive newline characters, it is only bumped once a non-newline character is seen.
We fix this by always bumping when has_newline is set, then checking afterwards for the \n character and setting has_newline = true

@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed parse failed with Chinese token in comment and bump deps.
- Added `first` method to `Punctuated`.
Copy link
Owner

Choose a reason for hiding this comment

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

oops,we need to move this

@Kampfkarren Kampfkarren merged commit 5a82627 into main Feb 25, 2023
@JohnnyMorganz JohnnyMorganz deleted the fix-tokenizer-positions branch February 25, 2023 17:32
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.

2 participants