Upgrade RustPython (#4900)

This commit is contained in:
Micha Reiser
2023-06-08 07:53:14 +02:00
committed by GitHub
parent 4b78141f6b
commit 39a1f3980f
51 changed files with 416 additions and 320 deletions

View File

@@ -18,6 +18,10 @@ pub trait PreorderVisitor<'a> {
walk_expr(self, expr);
}
fn visit_decorator(&mut self, decorator: &'a Decorator) {
walk_decorator(self, decorator);
}
fn visit_constant(&mut self, constant: &'a Constant) {
walk_constant(self, constant);
}
@@ -151,8 +155,8 @@ where
returns,
..
}) => {
for expr in decorator_list {
visitor.visit_expr(expr);
for decorator in decorator_list {
visitor.visit_decorator(decorator);
}
visitor.visit_arguments(args);
@@ -171,8 +175,8 @@ where
decorator_list,
..
}) => {
for expr in decorator_list {
visitor.visit_expr(expr);
for decorator in decorator_list {
visitor.visit_decorator(decorator);
}
for expr in bases {
@@ -387,6 +391,13 @@ where
}
}
pub fn walk_decorator<'a, V>(visitor: &mut V, decorator: &'a Decorator)
where
V: PreorderVisitor<'a> + ?Sized,
{
visitor.visit_expr(&decorator.expression);
}
pub fn walk_expr<'a, V>(visitor: &mut V, expr: &'a Expr)
where
V: PreorderVisitor<'a> + ?Sized,