[ruff] Autogenerate TypeParam nodes (#21028)

This commit is contained in:
Takayuki Maeda
2025-10-22 21:06:24 +09:00
committed by GitHub
parent 40148d7b11
commit 2c9433796a
37 changed files with 320 additions and 302 deletions

View File

@@ -506,67 +506,6 @@ impl ast::TypeParams {
}
}
impl ast::TypeParamTypeVar {
pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V)
where
V: SourceOrderVisitor<'a> + ?Sized,
{
let ast::TypeParamTypeVar {
bound,
default,
name,
range: _,
node_index: _,
} = self;
visitor.visit_identifier(name);
if let Some(expr) = bound {
visitor.visit_expr(expr);
}
if let Some(expr) = default {
visitor.visit_expr(expr);
}
}
}
impl ast::TypeParamTypeVarTuple {
#[inline]
pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V)
where
V: SourceOrderVisitor<'a> + ?Sized,
{
let ast::TypeParamTypeVarTuple {
range: _,
node_index: _,
name,
default,
} = self;
visitor.visit_identifier(name);
if let Some(expr) = default {
visitor.visit_expr(expr);
}
}
}
impl ast::TypeParamParamSpec {
#[inline]
pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V)
where
V: SourceOrderVisitor<'a> + ?Sized,
{
let ast::TypeParamParamSpec {
range: _,
node_index: _,
name,
default,
} = self;
visitor.visit_identifier(name);
if let Some(expr) = default {
visitor.visit_expr(expr);
}
}
}
impl ast::FString {
pub(crate) fn visit_source_order<'a, V>(&'a self, visitor: &mut V)
where