From 2257c08cb159a30492bf2aec172539b1dd504700 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 21:11:17 +0300 Subject: Add ret type --- crates/libsyntax2/src/ast/generated.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'crates/libsyntax2/src/ast/generated.rs') diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index 999023e3d..e8743caa8 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs @@ -523,6 +523,10 @@ impl<'a> FnDef<'a> { pub fn body(self) -> Option> { super::child_opt(self) } + + pub fn ret_type(self) -> Option> { + super::child_opt(self) + } } // FnPointerType @@ -1412,6 +1416,24 @@ impl<'a> AstNode<'a> for ReferenceType<'a> { impl<'a> ReferenceType<'a> {} +// RetType +#[derive(Debug, Clone, Copy)] +pub struct RetType<'a> { + syntax: SyntaxNodeRef<'a>, +} + +impl<'a> AstNode<'a> for RetType<'a> { + fn cast(syntax: SyntaxNodeRef<'a>) -> Option { + match syntax.kind() { + RET_TYPE => Some(RetType { syntax }), + _ => None, + } + } + fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } +} + +impl<'a> RetType<'a> {} + // ReturnExpr #[derive(Debug, Clone, Copy)] pub struct ReturnExpr<'a> { -- cgit v1.2.3