LibCST/native
Zsolt Dollenstein b230302947
Fix tokenizing 0else
This is an obscure one.

`_ if 0else _` failed to parse with some very weird errors. It turns out that the tokenizer tries to parse `0else` as a single number, but when it encounters `l` it realizes it can't be a single number and it backtracks.

Unfortunately the backtracking logic was broken, and it failed to correctly backtrack one of the offsets used for whitespace parsing (the byte offset since the start of the line). This caused whitespace nodes to refer to incorrect parts of the input text, eventually resulting in the above behavior.

This PR fixes the bookkeeping when the tokenizer backtracks.

Reported in #930.
2023-05-27 19:33:20 +01:00
..
libcst Fix tokenizing 0else 2023-05-27 19:33:20 +01:00
libcst_derive parser: use references instead of smart pointers for Tokens (#691) 2022-06-07 04:08:37 -06:00
Cargo.lock Bump bumpalo from 3.10.0 to 3.12.0 in /native (#856) 2023-03-27 10:55:42 +01:00
Cargo.toml Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
roundtrip.sh fix copyright headers and add a script to check (#635) 2022-02-01 11:13:17 +00:00