diff options
Diffstat (limited to 'crates/libsyntax2/src/ast')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 26 |
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 | ||
845 | impl<'a> MatchArm<'a> {} | 845 | impl<'a> MatchArm<'a> { |
846 | pub fn pats(self) -> impl Iterator<Item = Pat<'a>> + 'a { | ||
847 | super::children(self) | ||
848 | } | ||
849 | pub fn guard(self) -> Option<MatchGuard<'a>> { | ||
850 | super::child_opt(self) | ||
851 | } | ||
852 | pub 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 | ||
863 | impl<'a> MatchArmList<'a> {} | 873 | impl<'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 | ||
881 | impl<'a> MatchExpr<'a> {} | 895 | impl<'a> MatchExpr<'a> {pub fn expr(self) -> Option<Expr<'a>> { |
896 | super::child_opt(self) | ||
897 | } | ||
898 | pub 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)] |