diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs index 75971861aa..e880165366 100644 --- a/crates/syntax/src/ast/generated/nodes.rs +++ b/crates/syntax/src/ast/generated/nodes.rs @@ -8,110 +8,71 @@ use crate::{ }; #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct Name { +pub struct Abi { pub(crate) syntax: SyntaxNode, } -impl Name { - pub fn ident_token(&self) -> Option { support::token(&self.syntax, T![ident]) } - pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } +impl Abi { + pub fn extern_token(&self) -> Option { support::token(&self.syntax, T![extern]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct NameRef { +pub struct ArgList { pub(crate) syntax: SyntaxNode, } -impl NameRef { - pub fn ident_token(&self) -> Option { support::token(&self.syntax, T![ident]) } - pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } - pub fn super_token(&self) -> Option { support::token(&self.syntax, T![super]) } - pub fn crate_token(&self) -> Option { support::token(&self.syntax, T![crate]) } - pub fn Self_token(&self) -> Option { support::token(&self.syntax, T![Self]) } -} - -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct Lifetime { - pub(crate) syntax: SyntaxNode, -} -impl Lifetime { - pub fn lifetime_ident_token(&self) -> Option { - support::token(&self.syntax, T![lifetime_ident]) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct Path { - pub(crate) syntax: SyntaxNode, -} -impl Path { - pub fn qualifier(&self) -> Option { support::child(&self.syntax) } - pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } - pub fn segment(&self) -> Option { support::child(&self.syntax) } -} - -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct PathSegment { - pub(crate) syntax: SyntaxNode, -} -impl PathSegment { - pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } - pub fn name_ref(&self) -> Option { support::child(&self.syntax) } - pub fn generic_arg_list(&self) -> Option { support::child(&self.syntax) } - pub fn param_list(&self) -> Option { support::child(&self.syntax) } - pub fn ret_type(&self) -> Option { support::child(&self.syntax) } - pub fn l_angle_token(&self) -> Option { support::token(&self.syntax, T![<]) } - pub fn ty(&self) -> Option { support::child(&self.syntax) } - pub fn as_token(&self) -> Option { support::token(&self.syntax, T![as]) } - pub fn path_type(&self) -> Option { support::child(&self.syntax) } - pub fn r_angle_token(&self) -> Option { support::token(&self.syntax, T![>]) } -} - -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct GenericArgList { - pub(crate) syntax: SyntaxNode, -} -impl GenericArgList { - pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } - pub fn l_angle_token(&self) -> Option { support::token(&self.syntax, T![<]) } - pub fn generic_args(&self) -> AstChildren { support::children(&self.syntax) } - pub fn r_angle_token(&self) -> Option { support::token(&self.syntax, T![>]) } -} - -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct ParamList { - pub(crate) syntax: SyntaxNode, -} -impl ParamList { +impl ArgList { + pub fn args(&self) -> AstChildren { support::children(&self.syntax) } pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } - pub fn self_param(&self) -> Option { support::child(&self.syntax) } - pub fn comma_token(&self) -> Option { support::token(&self.syntax, T![,]) } - pub fn params(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_paren_token(&self) -> Option { support::token(&self.syntax, T![')']) } - pub fn pipe_token(&self) -> Option { support::token(&self.syntax, T![|]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct RetType { +pub struct ArrayExpr { pub(crate) syntax: SyntaxNode, } -impl RetType { - pub fn thin_arrow_token(&self) -> Option { support::token(&self.syntax, T![->]) } +impl ast::HasAttrs for ArrayExpr {} +impl ArrayExpr { + pub fn expr(&self) -> Option { support::child(&self.syntax) } + pub fn exprs(&self) -> AstChildren { support::children(&self.syntax) } + pub fn l_brack_token(&self) -> Option { support::token(&self.syntax, T!['[']) } + pub fn r_brack_token(&self) -> Option { support::token(&self.syntax, T![']']) } + pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct ArrayType { + pub(crate) syntax: SyntaxNode, +} +impl ArrayType { + pub fn const_arg(&self) -> Option { support::child(&self.syntax) } + pub fn l_brack_token(&self) -> Option { support::token(&self.syntax, T!['[']) } + pub fn r_brack_token(&self) -> Option { support::token(&self.syntax, T![']']) } + pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct PathType { +pub struct AsmExpr { pub(crate) syntax: SyntaxNode, } -impl PathType { - pub fn path(&self) -> Option { support::child(&self.syntax) } +impl ast::HasAttrs for AsmExpr {} +impl AsmExpr { + pub fn asm_token(&self) -> Option { support::token(&self.syntax, T![asm]) } + pub fn builtin_token(&self) -> Option { support::token(&self.syntax, T![builtin]) } + pub fn expr(&self) -> Option { support::child(&self.syntax) } + pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } + pub fn pound_token(&self) -> Option { support::token(&self.syntax, T![#]) } + pub fn r_paren_token(&self) -> Option { support::token(&self.syntax, T![')']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct TypeArg { +pub struct AssocItemList { pub(crate) syntax: SyntaxNode, } -impl TypeArg { - pub fn ty(&self) -> Option { support::child(&self.syntax) } +impl ast::HasAttrs for AssocItemList {} +impl AssocItemList { + pub fn assoc_items(&self) -> AstChildren { support::children(&self.syntax) } + pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } + pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -120,23 +81,146 @@ pub struct AssocTypeArg { } impl ast::HasTypeBounds for AssocTypeArg {} impl AssocTypeArg { - pub fn name_ref(&self) -> Option { support::child(&self.syntax) } + pub fn const_arg(&self) -> Option { support::child(&self.syntax) } + pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn generic_arg_list(&self) -> Option { support::child(&self.syntax) } + pub fn name_ref(&self) -> Option { support::child(&self.syntax) } pub fn param_list(&self) -> Option { support::child(&self.syntax) } pub fn ret_type(&self) -> Option { support::child(&self.syntax) } - pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } - pub fn const_arg(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct LifetimeArg { +pub struct Attr { pub(crate) syntax: SyntaxNode, } -impl LifetimeArg { +impl Attr { + pub fn excl_token(&self) -> Option { support::token(&self.syntax, T![!]) } + pub fn l_brack_token(&self) -> Option { support::token(&self.syntax, T!['[']) } + pub fn meta(&self) -> Option { support::child(&self.syntax) } + pub fn pound_token(&self) -> Option { support::token(&self.syntax, T![#]) } + pub fn r_brack_token(&self) -> Option { support::token(&self.syntax, T![']']) } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct AwaitExpr { + pub(crate) syntax: SyntaxNode, +} +impl ast::HasAttrs for AwaitExpr {} +impl AwaitExpr { + pub fn await_token(&self) -> Option { support::token(&self.syntax, T![await]) } + pub fn dot_token(&self) -> Option { support::token(&self.syntax, T![.]) } + pub fn expr(&self) -> Option { support::child(&self.syntax) } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct BecomeExpr { + pub(crate) syntax: SyntaxNode, +} +impl ast::HasAttrs for BecomeExpr {} +impl BecomeExpr { + pub fn become_token(&self) -> Option { support::token(&self.syntax, T![become]) } + pub fn expr(&self) -> Option { support::child(&self.syntax) } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct BinExpr { + pub(crate) syntax: SyntaxNode, +} +impl ast::HasAttrs for BinExpr {} +impl BinExpr {} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct BlockExpr { + pub(crate) syntax: SyntaxNode, +} +impl ast::HasAttrs for BlockExpr {} +impl BlockExpr { + pub fn async_token(&self) -> Option { support::token(&self.syntax, T![async]) } + pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } + pub fn label(&self) -> Option