From 7a5bc94774a50837f8c9bf8b96c8272882aca640 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Aug 2018 16:30:42 +0300 Subject: complete self --- crates/libsyntax2/src/ast/generated.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'crates/libsyntax2/src/ast') diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index 58dcf574e..50dc41b27 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs @@ -1168,6 +1168,9 @@ impl<'a> ParamList<'a> { pub fn params(self) -> impl Iterator> + 'a { super::children(self) } +pub fn self_param(self) -> Option> { + super::child_opt(self) + } } // ParenExpr @@ -1579,6 +1582,24 @@ impl<'a> Root<'a> { } } +// SelfParam +#[derive(Debug, Clone, Copy)] +pub struct SelfParam<'a> { + syntax: SyntaxNodeRef<'a>, +} + +impl<'a> AstNode<'a> for SelfParam<'a> { + fn cast(syntax: SyntaxNodeRef<'a>) -> Option { + match syntax.kind() { + SELF_PARAM => Some(SelfParam { syntax }), + _ => None, + } + } + fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } +} + +impl<'a> SelfParam<'a> {} + // SlicePat #[derive(Debug, Clone, Copy)] pub struct SlicePat<'a> { -- cgit v1.2.3