From 56aa6e20e0279c69e0130905573b1607056cfaf9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 11 Aug 2018 16:20:37 +0300 Subject: More symbols --- crates/libsyntax2/src/ast/generated.rs | 19 +++++++++++++++++++ crates/libsyntax2/src/grammar.ron | 29 ++++++++--------------------- 2 files changed, 27 insertions(+), 21 deletions(-) (limited to 'crates/libsyntax2') diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index a4b116941..31f5ecc44 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs @@ -180,3 +180,22 @@ impl AstNode for Trait { impl ast::NameOwner for Trait {} impl Trait {} +// TypeItem +#[derive(Debug, Clone, Copy)] +pub struct TypeItem> { + syntax: SyntaxNode, +} + +impl AstNode for TypeItem { + fn cast(syntax: SyntaxNode) -> Option { + match syntax.kind() { + TYPE_ITEM => Some(TypeItem { syntax }), + _ => None, + } + } + fn syntax(&self) -> &SyntaxNode { &self.syntax } +} + +impl ast::NameOwner for TypeItem {} +impl TypeItem {} + diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron index 3fe8fdf0b..d4e8c53d3 100644 --- a/crates/libsyntax2/src/grammar.ron +++ b/crates/libsyntax2/src/grammar.ron @@ -219,27 +219,14 @@ Grammar( ["functions", "Function"] ] ), - "Function": ( - traits: ["NameOwner"] - ), - "Struct": ( - traits: ["NameOwner"] - ), - "Enum": ( - traits: ["NameOwner"] - ), - "Trait": ( - traits: ["NameOwner"] - ), - "Module": ( - traits: ["NameOwner"] - ), - "ConstItem": ( - traits: ["NameOwner"] - ), - "StaticItem": ( - traits: ["NameOwner"] - ), + "Function": ( traits: ["NameOwner"] ), + "Struct": ( traits: ["NameOwner"] ), + "Enum": ( traits: ["NameOwner"] ), + "Trait": ( traits: ["NameOwner"] ), + "Module": ( traits: ["NameOwner"] ), + "ConstItem": ( traits: ["NameOwner"] ), + "StaticItem": ( traits: ["NameOwner"] ), + "TypeItem": ( traits: ["NameOwner"] ), "Name": (), }, ) -- cgit v1.2.3