From c1c97b289662501cea93fdc10760e08702ff5950 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 18:49:42 +0200 Subject: [PATCH] Fix leading colon --- crates/ra_syntax/src/ast/generated/nodes.rs | 2 +- xtask/src/codegen/rust.ungram | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 97a882bf0a..c25fa7d5f9 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -19,10 +19,10 @@ pub struct PathSegment { pub(crate) syntax: SyntaxNode, } impl PathSegment { - pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } pub fn crate_token(&self) -> Option { support::token(&self.syntax, T![crate]) } 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 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) } diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 8536b97481..1d8bed0b4b 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -2,7 +2,8 @@ Path = (qualifier:Path '::')? segment:PathSegment PathSegment = - '::' | 'crate' | 'self' | 'super' + 'crate' | 'self' | 'super' +| '::' NameRef | NameRef GenericArgList? | NameRef ParamList RetType? | '<' PathType ('as' PathType)? '>'