From 98718e0544f42e55642d2838b00d6a7bef1e2414 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 15 Jan 2021 21:07:38 +0100 Subject: Wrap remaining self/super/crate in Name{Ref} --- crates/syntax/src/ast/generated/nodes.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'crates/syntax/src/ast/generated') diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs index 1d722db3c..6407d7c85 100644 --- a/crates/syntax/src/ast/generated/nodes.rs +++ b/crates/syntax/src/ast/generated/nodes.rs @@ -11,6 +11,7 @@ pub struct Name { } 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]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct NameRef { @@ -238,7 +239,6 @@ impl ExternCrate { pub fn extern_token(&self) -> Option { support::token(&self.syntax, T![extern]) } pub fn crate_token(&self) -> Option { support::token(&self.syntax, T![crate]) } pub fn name_ref(&self) -> Option { support::child(&self.syntax) } - pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } pub fn rename(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } @@ -406,9 +406,6 @@ pub struct Visibility { impl Visibility { pub fn pub_token(&self) -> Option { support::token(&self.syntax, T![pub]) } pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } - pub fn super_token(&self) -> Option { support::token(&self.syntax, T![super]) } - pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } - pub fn crate_token(&self) -> Option { support::token(&self.syntax, T![crate]) } pub fn in_token(&self) -> Option { support::token(&self.syntax, T![in]) } pub fn path(&self) -> Option { support::child(&self.syntax) } pub fn r_paren_token(&self) -> Option { support::token(&self.syntax, T![')']) } @@ -492,11 +489,11 @@ pub struct SelfParam { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for SelfParam {} +impl ast::NameOwner for SelfParam {} impl SelfParam { pub fn amp_token(&self) -> Option { support::token(&self.syntax, T![&]) } pub fn lifetime(&self) -> Option { support::child(&self.syntax) } pub fn mut_token(&self) -> Option { support::token(&self.syntax, T![mut]) } - pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } } -- cgit v1.2.3