From 49e14a99ed4d0baf849bbd5766f6c16e7d37930c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Aug 2018 20:03:18 +0300 Subject: Complete types --- crates/libsyntax2/src/ast/generated.rs | 18 ++++++++++++++++++ crates/libsyntax2/src/grammar.ron | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'crates/libsyntax2/src') diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index d72e2091a..c2a22c8fc 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs @@ -1278,6 +1278,24 @@ impl<'a> AstNode<'a> for Pat<'a> { impl<'a> Pat<'a> {} +// Path +#[derive(Debug, Clone, Copy)] +pub struct Path<'a> { + syntax: SyntaxNodeRef<'a>, +} + +impl<'a> AstNode<'a> for Path<'a> { + fn cast(syntax: SyntaxNodeRef<'a>) -> Option { + match syntax.kind() { + PATH => Some(Path { syntax }), + _ => None, + } + } + fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } +} + +impl<'a> Path<'a> {} + // PathExpr #[derive(Debug, Clone, Copy)] pub struct PathExpr<'a> { diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron index 3c293d3e4..0bb40f5ab 100644 --- a/crates/libsyntax2/src/grammar.ron +++ b/crates/libsyntax2/src/grammar.ron @@ -513,6 +513,7 @@ Grammar( collections: [ ["args", "Expr"] ] - ) + ), + "Path": (), }, ) -- cgit v1.2.3