mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-13 07:08:19 +00:00
Add support for PEP 696 syntax (#11120)
This commit is contained in:
parent
45725d3275
commit
cd3e319538
49 changed files with 4338 additions and 669 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue