aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast/generated.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-02 23:51:46 +0100
committerAleksey Kladov <[email protected]>2018-09-02 23:51:46 +0100
commit23303cd0f8298c2d7b082fcb04919454c1c306ab (patch)
tree12c22fd573fb86f7718a68ec1d74eb62e401b2f6 /crates/libsyntax2/src/ast/generated.rs
parent83e2ab434cf20313c9248fbbe7e90f65f27d31ce (diff)
match scope
Diffstat (limited to 'crates/libsyntax2/src/ast/generated.rs')
-rw-r--r--crates/libsyntax2/src/ast/generated.rs26
1 files changed, 23 insertions, 3 deletions
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> {
842 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 842 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
843} 843}
844 844
845impl<'a> MatchArm<'a> {} 845impl<'a> MatchArm<'a> {
846 pub fn pats(self) -> impl Iterator<Item = Pat<'a>> + 'a {
847 super::children(self)
848 }
849pub fn guard(self) -> Option<MatchGuard<'a>> {
850 super::child_opt(self)
851 }
852pub fn expr(self) -> Option<Expr<'a>> {
853 super::child_opt(self)
854 }
855}
846 856
847// MatchArmList 857// MatchArmList
848#[derive(Debug, Clone, Copy)] 858#[derive(Debug, Clone, Copy)]
@@ -860,7 +870,11 @@ impl<'a> AstNode<'a> for MatchArmList<'a> {
860 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 870 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
861} 871}
862 872
863impl<'a> MatchArmList<'a> {} 873impl<'a> MatchArmList<'a> {
874 pub fn arms(self) -> impl Iterator<Item = MatchArm<'a>> + 'a {
875 super::children(self)
876 }
877}
864 878
865// MatchExpr 879// MatchExpr
866#[derive(Debug, Clone, Copy)] 880#[derive(Debug, Clone, Copy)]
@@ -878,7 +892,13 @@ impl<'a> AstNode<'a> for MatchExpr<'a> {
878 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 892 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
879} 893}
880 894
881impl<'a> MatchExpr<'a> {} 895impl<'a> MatchExpr<'a> {pub fn expr(self) -> Option<Expr<'a>> {
896 super::child_opt(self)
897 }
898pub fn match_arm_list(self) -> Option<MatchArmList<'a>> {
899 super::child_opt(self)
900 }
901}
882 902
883// MatchGuard 903// MatchGuard
884#[derive(Debug, Clone, Copy)] 904#[derive(Debug, Clone, Copy)]