ruff/crates/ruff_python_parser/src
Brent Westbrook f0fe6d62fb
Fix syntax error false positive on nested alternative patterns (#21104)
## Summary

Fixes #21101 by storing the child visitor's names in the parent visitor.
This makes sure that `visitor.names` on line 1818 isn't empty after we
visit a nested OR pattern.

## Test Plan

New inline test cases derived from the issue,
[playground](https://play.ruff.rs/7b6439ac-ee8f-4593-9a3e-c2aa34a595d0)
2025-10-30 13:40:03 -04:00
..
lexer Implement template strings (#17851) 2025-05-30 15:00:56 -05:00
parser Catch syntax errors in nested interpolations before Python 3.12 (#20949) 2025-10-20 09:03:13 -04:00
snapshots Improved error recovery for unclosed strings (including f- and t-strings) (#20848) 2025-10-15 09:50:56 +02:00
error.rs Combine `OldDiagnostic` and `Diagnostic` (#19053) 2025-07-03 13:01:09 -04:00
lexer.rs Improved error recovery for unclosed strings (including f- and t-strings) (#20848) 2025-10-15 09:50:56 +02:00
lib.rs [ty] Fix completions at end of file (#20993) 2025-10-21 09:24:31 +00:00
semantic_errors.rs Fix syntax error false positive on nested alternative patterns (#21104) 2025-10-30 13:40:03 -04:00
string.rs [ty] Shrink size of `AstNodeRef` (#20028) 2025-08-22 17:03:22 -04:00
token.rs [ty] Implement go-to for binary and unary operators (#21001) 2025-10-21 19:25:41 +02:00
token_set.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
token_source.rs Improved error recovery for unclosed strings (including f- and t-strings) (#20848) 2025-10-15 09:50:56 +02:00
typing.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00