Add support for PEP 696 syntax (#11120)
This commit is contained in:
@@ -4317,6 +4317,7 @@ impl AstNode for ast::TypeParamTypeVar {
|
||||
{
|
||||
let ast::TypeParamTypeVar {
|
||||
bound,
|
||||
default,
|
||||
name: _,
|
||||
range: _,
|
||||
} = self;
|
||||
@@ -4324,6 +4325,9 @@ impl AstNode for ast::TypeParamTypeVar {
|
||||
if let Some(expr) = bound {
|
||||
visitor.visit_expr(expr);
|
||||
}
|
||||
if let Some(expr) = default {
|
||||
visitor.visit_expr(expr);
|
||||
}
|
||||
}
|
||||
}
|
||||
impl AstNode for ast::TypeParamTypeVarTuple {
|
||||
@@ -4355,11 +4359,18 @@ impl AstNode for ast::TypeParamTypeVarTuple {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn visit_preorder<'a, V>(&'a self, _visitor: &mut V)
|
||||
fn visit_preorder<'a, V>(&'a self, visitor: &mut V)
|
||||
where
|
||||
V: PreorderVisitor<'a> + ?Sized,
|
||||
{
|
||||
let ast::TypeParamTypeVarTuple { range: _, name: _ } = self;
|
||||
let ast::TypeParamTypeVarTuple {
|
||||
range: _,
|
||||
name: _,
|
||||
default,
|
||||
} = self;
|
||||
if let Some(expr) = default {
|
||||
visitor.visit_expr(expr);
|
||||
}
|
||||
}
|
||||
}
|
||||
impl AstNode for ast::TypeParamParamSpec {
|
||||
@@ -4391,11 +4402,18 @@ impl AstNode for ast::TypeParamParamSpec {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn visit_preorder<'a, V>(&'a self, _visitor: &mut V)
|
||||
fn visit_preorder<'a, V>(&'a self, visitor: &mut V)
|
||||
where
|
||||
V: PreorderVisitor<'a> + ?Sized,
|
||||
{
|
||||
let ast::TypeParamParamSpec { range: _, name: _ } = self;
|
||||
let ast::TypeParamParamSpec {
|
||||
range: _,
|
||||
name: _,
|
||||
default,
|
||||
} = self;
|
||||
if let Some(expr) = default {
|
||||
visitor.visit_expr(expr);
|
||||
}
|
||||
}
|
||||
}
|
||||
impl AstNode for ast::FString {
|
||||
|
||||
Reference in New Issue
Block a user