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

Fixes for SourceFile byte offsets #311

Merged
merged 2 commits into from
Jun 20, 2023
Merged

Fixes for SourceFile byte offsets #311

merged 2 commits into from
Jun 20, 2023

Conversation

c42f
Copy link
Member

@c42f c42f commented Jun 20, 2023

This fixes a crash formatting error messages when core_parse_hook is used to parse a piece of broken code with a nontrivial byte offset.

  • SourceFile held by SyntaxNode preserves the indexing of the original string passed to the parse*() functions.
  • Fix source_line_range and thisind accordingly

c42f added 2 commits June 20, 2023 07:48
This fixes a crash formatting error messages when core_parse_hook is
used to parse a piece of broken code with a nontrivial byte offset.

* `SourceFile` held by `SyntaxNode` preserves the indexing of the original
  string passed to the `parse*()` functions.
* Fix `source_line_range` and `thisind` accordingly
@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #311 (325a850) into main (ec51994) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
+ Coverage   96.78%   96.80%   +0.01%     
==========================================
  Files          14       14              
  Lines        4111     4125      +14     
==========================================
+ Hits         3979     3993      +14     
  Misses        132      132              
Impacted Files Coverage Δ
src/diagnostics.jl 100.00% <ø> (ø)
src/expr.jl 100.00% <100.00%> (ø)
src/parse_stream.jl 95.41% <100.00%> (+0.03%) ⬆️
src/parser.jl 98.03% <100.00%> (-0.30%) ⬇️
src/parser_api.jl 93.75% <100.00%> (ø)
src/source_files.jl 97.36% <100.00%> (ø)
src/syntax_tree.jl 95.36% <100.00%> (+0.09%) ⬆️

... and 2 files with indirect coverage changes

@c42f c42f merged commit c076e10 into main Jun 20, 2023
@c42f c42f deleted the c42f/fix-SourceFile-offsets branch June 20, 2023 02:46
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.

1 participant