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 columns being off by one / implement line cache #1174

Merged
merged 4 commits into from
Mar 15, 2020
Merged

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Mar 15, 2020

Turned out that column numbers in diagnostics used to be off by one, starting at 0 instead of 1.

Also took the opportunity to implement a line cache aiding in determining the line number for a given source position using a little binary search instead of walking the source. Saves a second or so on the non-parallel test suite (~1.8%).

In turn I also removed the Range#line and Range#column properties in preparation of making the AST more easily serializable eventually.

@dcodeIO dcodeIO requested a review from MaxGraey March 15, 2020 10:19
@dcodeIO dcodeIO merged commit 960890e into master Mar 15, 2020
@dcodeIO dcodeIO deleted the linecache branch March 15, 2020 13:34
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