Align grammar for record patterns and literals

The grammar now looks like this

   [name_ref :] pat
This commit is contained in:
Aleksey Kladov 2020-04-11 23:33:17 +02:00
parent 6b49e774e2
commit 5e5eb6a108
18 changed files with 145 additions and 90 deletions

View file

@ -1806,8 +1806,8 @@ impl AstNode for RecordFieldPat {
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl ast::AttrsOwner for RecordFieldPat {}
impl ast::NameOwner for RecordFieldPat {}
impl RecordFieldPat {
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
}