From 8b0298ce095b6dd635f7ed35dc97f1874157040b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 27 Aug 2018 10:01:31 +0300 Subject: scopes --- crates/libsyntax2/src/ast/generated.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'crates/libsyntax2/src/ast') diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index 6926c0535..b937fe5a2 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs @@ -383,6 +383,24 @@ impl<'a> AstNode<'a> for Expr<'a> { impl<'a> Expr<'a> {} +// ExprStmt +#[derive(Debug, Clone, Copy)] +pub struct ExprStmt<'a> { + syntax: SyntaxNodeRef<'a>, +} + +impl<'a> AstNode<'a> for ExprStmt<'a> { + fn cast(syntax: SyntaxNodeRef<'a>) -> Option { + match syntax.kind() { + EXPR_STMT => Some(ExprStmt { syntax }), + _ => None, + } + } + fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } +} + +impl<'a> ExprStmt<'a> {} + // FieldExpr #[derive(Debug, Clone, Copy)] pub struct FieldExpr<'a> { @@ -442,6 +460,10 @@ impl<'a> FnDef<'a> { pub fn param_list(self) -> Option> { super::child_opt(self) } + + pub fn body(self) -> Option> { + super::child_opt(self) + } } // FnPointerType @@ -626,6 +648,10 @@ impl<'a> LetStmt<'a> { pub fn pat(self) -> Option> { super::child_opt(self) } + + pub fn initializer(self) -> Option> { + super::child_opt(self) + } } // LoopExpr -- cgit v1.2.3