diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-07-17 17:59:05 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-07-19 15:25:55 +1000 |
| commit | ca6649516f24fcfabeeee07e287d4de8958e83fe (patch) | |
| tree | f55dde27c1e973c93191615a996764c8dcfc8d70 /compiler/rustc_parse/src/parser/tests.rs | |
| parent | f9c7ca70cb3a10e0113113d054b9214b98455ae5 (diff) | |
| download | rust-ca6649516f24fcfabeeee07e287d4de8958e83fe.tar.gz rust-ca6649516f24fcfabeeee07e287d4de8958e83fe.zip | |
Make `Parser::num_bump_calls` 0-indexed.
Currently in `collect_tokens_trailing_token`, `start_pos` and `end_pos` are 1-indexed by `replace_ranges` is 0-indexed, which is really confusing. Making them both 0-indexed makes debugging much easier.
Diffstat (limited to 'compiler/rustc_parse/src/parser/tests.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/tests.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/parser/tests.rs b/compiler/rustc_parse/src/parser/tests.rs index cf791d332a2..491aa71155a 100644 --- a/compiler/rustc_parse/src/parser/tests.rs +++ b/compiler/rustc_parse/src/parser/tests.rs @@ -1522,7 +1522,7 @@ fn debug_lookahead() { }, }, tokens: [], - approx_token_stream_pos: 1, + approx_token_stream_pos: 0, .. }" ); @@ -1566,7 +1566,7 @@ fn debug_lookahead() { Parenthesis, ), ], - approx_token_stream_pos: 1, + approx_token_stream_pos: 0, .. }" ); @@ -1631,7 +1631,7 @@ fn debug_lookahead() { Semi, Eof, ], - approx_token_stream_pos: 1, + approx_token_stream_pos: 0, .. }" ); @@ -1663,7 +1663,7 @@ fn debug_lookahead() { No, ), ], - approx_token_stream_pos: 9, + approx_token_stream_pos: 8, .. }" ); @@ -1701,7 +1701,7 @@ fn debug_lookahead() { No, ), ], - approx_token_stream_pos: 9, + approx_token_stream_pos: 8, .. }" ); @@ -1728,7 +1728,7 @@ fn debug_lookahead() { tokens: [ Eof, ], - approx_token_stream_pos: 15, + approx_token_stream_pos: 14, .. }" ); |
