LibCST/native/libcst/tests/fixtures
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
..
big_binary_operator.py [native] Box most enums (#632) 2022-01-28 10:33:33 +00:00
class_craziness.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
comments.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
comparisons.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
dangling_indent.py Make sure dedents are emitted for inputs without trailing newlines (#573) 2022-01-04 20:04:21 +00:00
decorated_function_without_body.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
dysfunctional_del.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
expr.py Fix tokenizing 0else 2023-05-27 19:33:20 +01:00
expr_statement.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
fun_with_func_defs.py Support whitespace after ParamSlash (#713) 2022-06-26 09:42:37 +01:00
global_nonlocal.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
import.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
indents_but_no_eol_before_eof.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
just_a_comment_without_nl.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
malicious_match.py Implement PEP-634 - Match statement (#568) 2021-12-30 10:00:51 +00:00
pep646.py Add support for PEP-646 (#696) 2022-06-13 09:52:31 -06:00
raise.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
smol_statements.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
spacious_spaces.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
starry_tries.py implement PEP-654: except* (#571) 2021-12-29 21:23:46 +00:00
suicidal_slices.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
super_strings.py Fix parsing of nested f-string specifiers 2023-05-27 13:00:20 +01:00
terrible_tries.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
trailing_comment_without_nl.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
tuple_shenanigans.py Fix parsing of parenthesized empty tuples (#712) 2022-06-26 09:41:49 +01:00
vast_emptiness.py Implement a Python PEG parser in Rust (#566) 2021-12-21 18:14:39 +00:00
with_wickedness.py Fix Github issue 855 - fail to parse with statement (#861) 2023-02-16 10:49:05 -08:00
wonky_walrus.py Allow walrus in slices 2023-05-27 10:07:19 +01:00