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 syntax error line numbers, delay computation #331

Merged
merged 1 commit into from Nov 10, 2018

Conversation

alangpierce
Copy link
Owner

We internally throw and catch syntax errors in a number of cases, and from some
profiling work, a lot of the time was spent generating the line number from the
source code offset, which the user will never see. Now, we only include the line
and column numbers when the exception is thrown from the top level of the
parser.

Also, the code to compute line numbers was completely broken anyway (everything
was showing up as on the first line), so this fixes it and adds a test.

We internally throw and catch syntax errors in a number of cases, and from some
profiling work, a lot of the time was spent generating the line number from the
source code offset, which the user will never see. Now, we only include the line
and column numbers when the exception is thrown from the top level of the
parser.

Also, the code to compute line numbers was completely broken anyway (everything
was showing up as on the first line), so this fixes it and adds a test.
@codecov-io
Copy link

Codecov Report

Merging #331 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #331   +/-   ##
=====================================
  Coverage       0%     0%           
=====================================
  Files          23     23           
  Lines        2074   2078    +4     
  Branches      605    606    +1     
=====================================
- Misses       2074   2078    +4
Impacted Files Coverage Δ
src/parser/traverser/base.ts 0% <0%> (ø) ⬆️
src/parser/index.ts 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52f92bc...6e7e3ad. Read the comment docs.

@alangpierce alangpierce merged commit dcda5b0 into master Nov 10, 2018
@alangpierce alangpierce deleted the fix-line-numbers-and-lazy-compute branch November 10, 2018 23:54
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.

None yet

2 participants