mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 06:41:23 +00:00
SourceOrderVisitor
should visit the Identifier
part of the PatternKeyword
node (#18635)
This commit is contained in:
parent
65a2c6d4eb
commit
f74527f4e9
2 changed files with 4 additions and 2 deletions
|
@ -501,7 +501,7 @@ where
|
||||||
{
|
{
|
||||||
let node = AnyNodeRef::from(pattern_keyword);
|
let node = AnyNodeRef::from(pattern_keyword);
|
||||||
if visitor.enter_node(node).is_traverse() {
|
if visitor.enter_node(node).is_traverse() {
|
||||||
visitor.visit_pattern(&pattern_keyword.pattern);
|
pattern_keyword.visit_source_order(visitor);
|
||||||
}
|
}
|
||||||
visitor.leave_node(node);
|
visitor.leave_node(node);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
source: crates/ruff_python_ast_integration_tests/tests/source_order.rs
|
source: crates/ruff_python_ast_integration_tests/tests/source_order.rs
|
||||||
expression: trace
|
expression: trace
|
||||||
snapshot_kind: text
|
|
||||||
---
|
---
|
||||||
- ModModule
|
- ModModule
|
||||||
- StmtMatch
|
- StmtMatch
|
||||||
|
@ -21,12 +20,15 @@ snapshot_kind: text
|
||||||
- ExprName
|
- ExprName
|
||||||
- PatternArguments
|
- PatternArguments
|
||||||
- PatternKeyword
|
- PatternKeyword
|
||||||
|
- Identifier
|
||||||
- PatternMatchValue
|
- PatternMatchValue
|
||||||
- ExprNumberLiteral
|
- ExprNumberLiteral
|
||||||
- PatternKeyword
|
- PatternKeyword
|
||||||
|
- Identifier
|
||||||
- PatternMatchValue
|
- PatternMatchValue
|
||||||
- ExprNumberLiteral
|
- ExprNumberLiteral
|
||||||
- PatternKeyword
|
- PatternKeyword
|
||||||
|
- Identifier
|
||||||
- PatternMatchValue
|
- PatternMatchValue
|
||||||
- ExprNumberLiteral
|
- ExprNumberLiteral
|
||||||
- StmtExpr
|
- StmtExpr
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue