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 #1793. offsets off of end of source should not assert. #1804

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

enebo
Copy link
Collaborator

@enebo enebo commented Nov 10, 2023

There are cases where prism will run into a syntax error and advance to at least 1 byte past the end of source (beyond just regexps like as described in #1793). There are many places this can happen so this PR fixes this issue by adjusting the offset we are trying to determine the line for to the last valid byteoffset in the source.

There are cases where prism will run into a syntax error and advance to
at least 1 byte past the end of source (beyond just regexps like as described
in ruby#1793).  There are many places this can happen so this PR fixes this
issue by adjusting the offset we are trying to determine the line for to
the last valid byteoffset in the source.
@kddnewton kddnewton merged commit b098a7c into ruby:main Nov 10, 2023
46 checks passed
@enebo enebo deleted the fix_runoff_offsets branch November 10, 2023 20:19
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