From 23303cd0f8298c2d7b082fcb04919454c1c306ab Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 3 Sep 2018 01:51:46 +0300 Subject: match scope --- crates/libsyntax2/src/ast/generated.rs | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'crates/libsyntax2/src/ast') diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index f21e49437..bdee635ae 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs @@ -842,7 +842,17 @@ impl<'a> AstNode<'a> for MatchArm<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> MatchArm<'a> {} +impl<'a> MatchArm<'a> { + pub fn pats(self) -> impl Iterator> + 'a { + super::children(self) + } +pub fn guard(self) -> Option> { + super::child_opt(self) + } +pub fn expr(self) -> Option> { + super::child_opt(self) + } +} // MatchArmList #[derive(Debug, Clone, Copy)] @@ -860,7 +870,11 @@ impl<'a> AstNode<'a> for MatchArmList<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> MatchArmList<'a> {} +impl<'a> MatchArmList<'a> { + pub fn arms(self) -> impl Iterator> + 'a { + super::children(self) + } +} // MatchExpr #[derive(Debug, Clone, Copy)] @@ -878,7 +892,13 @@ impl<'a> AstNode<'a> for MatchExpr<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> MatchExpr<'a> {} +impl<'a> MatchExpr<'a> {pub fn expr(self) -> Option> { + super::child_opt(self) + } +pub fn match_arm_list(self) -> Option> { + super::child_opt(self) + } +} // MatchGuard #[derive(Debug, Clone, Copy)] -- cgit v1.2.3