LibCST/native/libcst/src
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
..
nodes Support whitespace after ParamSlash (#713) 2022-06-26 09:42:37 +01:00
parser Allow walrus in slices 2023-05-27 10:07:19 +01:00
tokenizer Fix tokenizing 0else 2023-05-27 19:33:20 +01:00
bin.rs fix copyright headers and add a script to check (#635) 2022-02-01 11:13:17 +00:00
lib.rs parser: use references instead of smart pointers for Tokens (#691) 2022-06-07 04:08:37 -06:00
py.rs [native] Make IntoPy conversion fallible (#639) 2022-02-07 11:52:29 +00:00