about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-25 13:12:45 +0200
committerGitHub <noreply@github.com>2019-10-25 13:12:45 +0200
commit1f93be1bb3f89d6b30a3ddc39e8a462924ccd503 (patch)
treeddc93b333040abfda9dd252818e026760f8e0fa3 /src/libsyntax/parse
parent959b6e324ce2786a4adade6cef222ffbd20f3791 (diff)
parentff1860ad763baac652d3a43a93985e29ade805cb (diff)
downloadrust-1f93be1bb3f89d6b30a3ddc39e8a462924ccd503.tar.gz
rust-1f93be1bb3f89d6b30a3ddc39e8a462924ccd503.zip
Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad
Fix the start/end byte positions in the compiler JSON output

Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output.

This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one.

The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions.

Fixes #65029
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions