aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast/generated.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/ast/generated.rs')
-rw-r--r--crates/libsyntax2/src/ast/generated.rs78
1 files changed, 26 insertions, 52 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs
index 0668dbfa7..58dcf574e 100644
--- a/crates/libsyntax2/src/ast/generated.rs
+++ b/crates/libsyntax2/src/ast/generated.rs
@@ -78,8 +78,7 @@ impl<'a> AstNode<'a> for Attr<'a> {
78 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 78 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
79} 79}
80 80
81impl<'a> Attr<'a> { 81impl<'a> Attr<'a> {pub fn value(self) -> Option<TokenTree<'a>> {
82 pub fn value(self) -> Option<TokenTree<'a>> {
83 super::child_opt(self) 82 super::child_opt(self)
84 } 83 }
85} 84}
@@ -141,8 +140,7 @@ impl<'a> Block<'a> {
141 pub fn statements(self) -> impl Iterator<Item = Stmt<'a>> + 'a { 140 pub fn statements(self) -> impl Iterator<Item = Stmt<'a>> + 'a {
142 super::children(self) 141 super::children(self)
143 } 142 }
144 143pub fn expr(self) -> Option<Expr<'a>> {
145 pub fn expr(self) -> Option<Expr<'a>> {
146 super::child_opt(self) 144 super::child_opt(self)
147 } 145 }
148} 146}
@@ -163,8 +161,7 @@ impl<'a> AstNode<'a> for BlockExpr<'a> {
163 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 161 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
164} 162}
165 163
166impl<'a> BlockExpr<'a> { 164impl<'a> BlockExpr<'a> {pub fn block(self) -> Option<Block<'a>> {
167 pub fn block(self) -> Option<Block<'a>> {
168 super::child_opt(self) 165 super::child_opt(self)
169 } 166 }
170} 167}
@@ -203,12 +200,10 @@ impl<'a> AstNode<'a> for CallExpr<'a> {
203 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 200 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
204} 201}
205 202
206impl<'a> CallExpr<'a> { 203impl<'a> CallExpr<'a> {pub fn expr(self) -> Option<Expr<'a>> {
207 pub fn expr(self) -> Option<Expr<'a>> {
208 super::child_opt(self) 204 super::child_opt(self)
209 } 205 }
210 206pub fn arg_list(self) -> Option<ArgList<'a>> {
211 pub fn arg_list(self) -> Option<ArgList<'a>> {
212 super::child_opt(self) 207 super::child_opt(self)
213 } 208 }
214} 209}
@@ -247,12 +242,10 @@ impl<'a> AstNode<'a> for Condition<'a> {
247 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 242 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
248} 243}
249 244
250impl<'a> Condition<'a> { 245impl<'a> Condition<'a> {pub fn pat(self) -> Option<Pat<'a>> {
251 pub fn pat(self) -> Option<Pat<'a>> {
252 super::child_opt(self) 246 super::child_opt(self)
253 } 247 }
254 248pub fn expr(self) -> Option<Expr<'a>> {
255 pub fn expr(self) -> Option<Expr<'a>> {
256 super::child_opt(self) 249 super::child_opt(self)
257 } 250 }
258} 251}
@@ -466,8 +459,7 @@ impl<'a> AstNode<'a> for ExprStmt<'a> {
466 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 459 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
467} 460}
468 461
469impl<'a> ExprStmt<'a> { 462impl<'a> ExprStmt<'a> {pub fn expr(self) -> Option<Expr<'a>> {
470 pub fn expr(self) -> Option<Expr<'a>> {
471 super::child_opt(self) 463 super::child_opt(self)
472 } 464 }
473} 465}
@@ -545,16 +537,13 @@ impl<'a> AstNode<'a> for FnDef<'a> {
545impl<'a> ast::NameOwner<'a> for FnDef<'a> {} 537impl<'a> ast::NameOwner<'a> for FnDef<'a> {}
546impl<'a> ast::TypeParamsOwner<'a> for FnDef<'a> {} 538impl<'a> ast::TypeParamsOwner<'a> for FnDef<'a> {}
547impl<'a> ast::AttrsOwner<'a> for FnDef<'a> {} 539impl<'a> ast::AttrsOwner<'a> for FnDef<'a> {}
548impl<'a> FnDef<'a> { 540impl<'a> FnDef<'a> {pub fn param_list(self) -> Option<ParamList<'a>> {
549 pub fn param_list(self) -> Option<ParamList<'a>> {
550 super::child_opt(self) 541 super::child_opt(self)
551 } 542 }
552 543pub fn body(self) -> Option<Block<'a>> {
553 pub fn body(self) -> Option<Block<'a>> {
554 super::child_opt(self) 544 super::child_opt(self)
555 } 545 }
556 546pub fn ret_type(self) -> Option<RetType<'a>> {
557 pub fn ret_type(self) -> Option<RetType<'a>> {
558 super::child_opt(self) 547 super::child_opt(self)
559 } 548 }
560} 549}
@@ -594,12 +583,10 @@ impl<'a> AstNode<'a> for ForExpr<'a> {
594} 583}
595 584
596impl<'a> ast::LoopBodyOwner<'a> for ForExpr<'a> {} 585impl<'a> ast::LoopBodyOwner<'a> for ForExpr<'a> {}
597impl<'a> ForExpr<'a> { 586impl<'a> ForExpr<'a> {pub fn pat(self) -> Option<Pat<'a>> {
598 pub fn pat(self) -> Option<Pat<'a>> {
599 super::child_opt(self) 587 super::child_opt(self)
600 } 588 }
601 589pub fn iterable(self) -> Option<Expr<'a>> {
602 pub fn iterable(self) -> Option<Expr<'a>> {
603 super::child_opt(self) 590 super::child_opt(self)
604 } 591 }
605} 592}
@@ -638,8 +625,7 @@ impl<'a> AstNode<'a> for IfExpr<'a> {
638 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 625 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
639} 626}
640 627
641impl<'a> IfExpr<'a> { 628impl<'a> IfExpr<'a> {pub fn condition(self) -> Option<Condition<'a>> {
642 pub fn condition(self) -> Option<Condition<'a>> {
643 super::child_opt(self) 629 super::child_opt(self)
644 } 630 }
645} 631}
@@ -732,12 +718,10 @@ impl<'a> AstNode<'a> for LambdaExpr<'a> {
732 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 718 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
733} 719}
734 720
735impl<'a> LambdaExpr<'a> { 721impl<'a> LambdaExpr<'a> {pub fn param_list(self) -> Option<ParamList<'a>> {
736 pub fn param_list(self) -> Option<ParamList<'a>> {
737 super::child_opt(self) 722 super::child_opt(self)
738 } 723 }
739 724pub fn body(self) -> Option<Expr<'a>> {
740 pub fn body(self) -> Option<Expr<'a>> {
741 super::child_opt(self) 725 super::child_opt(self)
742 } 726 }
743} 727}
@@ -758,12 +742,10 @@ impl<'a> AstNode<'a> for LetStmt<'a> {
758 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 742 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
759} 743}
760 744
761impl<'a> LetStmt<'a> { 745impl<'a> LetStmt<'a> {pub fn pat(self) -> Option<Pat<'a>> {
762 pub fn pat(self) -> Option<Pat<'a>> {
763 super::child_opt(self) 746 super::child_opt(self)
764 } 747 }
765 748pub fn initializer(self) -> Option<Expr<'a>> {
766 pub fn initializer(self) -> Option<Expr<'a>> {
767 super::child_opt(self) 749 super::child_opt(self)
768 } 750 }
769} 751}
@@ -802,8 +784,7 @@ impl<'a> AstNode<'a> for LifetimeParam<'a> {
802 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 784 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
803} 785}
804 786
805impl<'a> LifetimeParam<'a> { 787impl<'a> LifetimeParam<'a> {pub fn lifetime(self) -> Option<Lifetime<'a>> {
806 pub fn lifetime(self) -> Option<Lifetime<'a>> {
807 super::child_opt(self) 788 super::child_opt(self)
808 } 789 }
809} 790}
@@ -1162,8 +1143,7 @@ impl<'a> AstNode<'a> for Param<'a> {
1162 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 1143 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
1163} 1144}
1164 1145
1165impl<'a> Param<'a> { 1146impl<'a> Param<'a> {pub fn pat(self) -> Option<Pat<'a>> {
1166 pub fn pat(self) -> Option<Pat<'a>> {
1167 super::child_opt(self) 1147 super::child_opt(self)
1168 } 1148 }
1169} 1149}
@@ -1291,8 +1271,7 @@ impl<'a> AstNode<'a> for Path<'a> {
1291 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 1271 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
1292} 1272}
1293 1273
1294impl<'a> Path<'a> { 1274impl<'a> Path<'a> {pub fn segment(self) -> Option<PathSegment<'a>> {
1295 pub fn segment(self) -> Option<PathSegment<'a>> {
1296 super::child_opt(self) 1275 super::child_opt(self)
1297 } 1276 }
1298} 1277}
@@ -1349,8 +1328,7 @@ impl<'a> AstNode<'a> for PathSegment<'a> {
1349 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 1328 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
1350} 1329}
1351 1330
1352impl<'a> PathSegment<'a> { 1331impl<'a> PathSegment<'a> {pub fn name_ref(self) -> Option<NameRef<'a>> {
1353 pub fn name_ref(self) -> Option<NameRef<'a>> {
1354 super::child_opt(self) 1332 super::child_opt(self)
1355 } 1333 }
1356} 1334}
@@ -2012,8 +1990,7 @@ impl<'a> AstNode<'a> for UseItem<'a> {
2012 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 1990 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
2013} 1991}
2014 1992
2015impl<'a> UseItem<'a> { 1993impl<'a> UseItem<'a> {pub fn use_tree(self) -> Option<UseTree<'a>> {
2016 pub fn use_tree(self) -> Option<UseTree<'a>> {
2017 super::child_opt(self) 1994 super::child_opt(self)
2018 } 1995 }
2019} 1996}
@@ -2034,12 +2011,10 @@ impl<'a> AstNode<'a> for UseTree<'a> {
2034 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } 2011 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
2035} 2012}
2036 2013
2037impl<'a> UseTree<'a> { 2014impl<'a> UseTree<'a> {pub fn path(self) -> Option<Path<'a>> {
2038 pub fn path(self) -> Option<Path<'a>> {
2039 super::child_opt(self) 2015 super::child_opt(self)
2040 } 2016 }
2041 2017pub fn use_tree_list(self) -> Option<UseTreeList<'a>> {
2042 pub fn use_tree_list(self) -> Option<UseTreeList<'a>> {
2043 super::child_opt(self) 2018 super::child_opt(self)
2044 } 2019 }
2045} 2020}
@@ -2101,8 +2076,7 @@ impl<'a> AstNode<'a> for WhileExpr<'a> {
2101} 2076}
2102 2077
2103impl<'a> ast::LoopBodyOwner<'a> for WhileExpr<'a> {} 2078impl<'a> ast::LoopBodyOwner<'a> for WhileExpr<'a> {}
2104impl<'a> WhileExpr<'a> { 2079impl<'a> WhileExpr<'a> {pub fn condition(self) -> Option<Condition<'a>> {
2105 pub fn condition(self) -> Option<Condition<'a>> {
2106 super::child_opt(self) 2080 super::child_opt(self)
2107 } 2081 }
2108} 2082}