Skip to content

Commit

Permalink
Visit arguments in correct order
Browse files Browse the repository at this point in the history
  • Loading branch information
jgberry committed Jun 20, 2023
1 parent 48f4f2d commit d23461a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/ruff_python_ast/src/visitor.rs
Expand Up @@ -603,6 +603,12 @@ pub fn walk_excepthandler<'a, V: Visitor<'a> + ?Sized>(
}

pub fn walk_arguments<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, arguments: &'a Arguments) {
for expr in &arguments.defaults {
visitor.visit_expr(expr);
}
for expr in &arguments.kw_defaults {
visitor.visit_expr(expr);
}
for arg in &arguments.posonlyargs {
visitor.visit_arg(arg);
}
Expand All @@ -615,15 +621,9 @@ pub fn walk_arguments<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, arguments: &
for arg in &arguments.kwonlyargs {
visitor.visit_arg(arg);
}
for expr in &arguments.kw_defaults {
visitor.visit_expr(expr);
}
if let Some(arg) = &arguments.kwarg {
visitor.visit_arg(arg);
}
for expr in &arguments.defaults {
visitor.visit_expr(expr);
}
}

pub fn walk_arg<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, arg: &'a Arg) {
Expand Down

0 comments on commit d23461a

Please sign in to comment.