rust/src/libsyntax_pos
Mazdak Farrokhzad 1f93be1bb3
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
2019-10-25 13:12:45 +02:00
..
analyze_source_file libsyntax_pos: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
symbol Remove gensyms 2019-10-15 21:12:05 +01:00
analyze_source_file.rs libsyntax_pos: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
Cargo.toml remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
edition.rs syntax_pos: Remove the duplicate global edition 2019-08-15 20:41:45 +03:00
hygiene.rs Rollup merge of #64486 - matthewjasper:hygiene-debugging, r=petrochenkov 2019-09-17 21:27:22 -07:00
lib.rs Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad 2019-10-25 13:12:45 +02:00
span_encoding.rs Increase Span from 4 bytes to 8 bytes. 2019-04-05 12:26:09 +11:00
symbol.rs Rollup merge of #65657 - nnethercote:rm-InternedString-properly, r=eddyb 2019-10-23 22:19:19 +02:00
tests.rs Fix the start/end byte positions in the compiler JSON output 2019-10-21 19:28:29 +03:00