From c579b47b4a2e702c6c5e7eac979486c81675f036 Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Wed, 10 Oct 2018 17:18:21 +0200 Subject: Update generated.rs.tera Removing `-` for #114 --- crates/ra_syntax/src/ast/generated.rs.tera | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/ra_syntax/src/ast') diff --git a/crates/ra_syntax/src/ast/generated.rs.tera b/crates/ra_syntax/src/ast/generated.rs.tera index ceb2cd7e2..ffa9c4134 100644 --- a/crates/ra_syntax/src/ast/generated.rs.tera +++ b/crates/ra_syntax/src/ast/generated.rs.tera @@ -77,8 +77,7 @@ impl<'a> {{ node }}<'a> { {%- else -%} {%- set method_name = m.0 -%} {%- set ChildName = m.1 %} -{%- endif -%} - +{%- endif %} pub fn {{ method_name }}(self) -> Option<{{ ChildName }}<'a>> { super::child_opt(self) } -- cgit v1.2.3 From 6abecf76e51599c71a351ea45a78eed1d1cef8af Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Wed, 10 Oct 2018 17:26:01 +0200 Subject: Update crates/ra_syntax/src/ast/generated.rs effect of running cargo gen-kinds --- crates/ra_syntax/src/ast/generated.rs | 96 +++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 32 deletions(-) (limited to 'crates/ra_syntax/src/ast') diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 2db6dff1b..f27093291 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -81,7 +81,8 @@ impl<'a> AstNode<'a> for Attr<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> Attr<'a> {pub fn value(self) -> Option> { +impl<'a> Attr<'a> { + pub fn value(self) -> Option> { super::child_opt(self) } } @@ -143,7 +144,8 @@ impl<'a> Block<'a> { pub fn statements(self) -> impl Iterator> + 'a { super::children(self) } -pub fn expr(self) -> Option> { + + pub fn expr(self) -> Option> { super::child_opt(self) } } @@ -164,7 +166,8 @@ impl<'a> AstNode<'a> for BlockExpr<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> BlockExpr<'a> {pub fn block(self) -> Option> { +impl<'a> BlockExpr<'a> { + pub fn block(self) -> Option> { super::child_opt(self) } } @@ -204,7 +207,8 @@ impl<'a> AstNode<'a> for CallExpr<'a> { } impl<'a> ast::ArgListOwner<'a> for CallExpr<'a> {} -impl<'a> CallExpr<'a> {pub fn expr(self) -> Option> { +impl<'a> CallExpr<'a> { + pub fn expr(self) -> Option> { super::child_opt(self) } } @@ -243,10 +247,12 @@ impl<'a> AstNode<'a> for Condition<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> Condition<'a> {pub fn pat(self) -> Option> { +impl<'a> Condition<'a> { + pub fn pat(self) -> Option> { super::child_opt(self) } -pub fn expr(self) -> Option> { + + pub fn expr(self) -> Option> { super::child_opt(self) } } @@ -460,7 +466,8 @@ impl<'a> AstNode<'a> for ExprStmt<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> ExprStmt<'a> {pub fn expr(self) -> Option> { +impl<'a> ExprStmt<'a> { + pub fn expr(self) -> Option> { super::child_opt(self) } } @@ -538,13 +545,16 @@ impl<'a> AstNode<'a> for FnDef<'a> { impl<'a> ast::NameOwner<'a> for FnDef<'a> {} impl<'a> ast::TypeParamsOwner<'a> for FnDef<'a> {} impl<'a> ast::AttrsOwner<'a> for FnDef<'a> {} -impl<'a> FnDef<'a> {pub fn param_list(self) -> Option> { +impl<'a> FnDef<'a> { + pub fn param_list(self) -> Option> { super::child_opt(self) } -pub fn body(self) -> Option> { + + pub fn body(self) -> Option> { super::child_opt(self) } -pub fn ret_type(self) -> Option> { + + pub fn ret_type(self) -> Option> { super::child_opt(self) } } @@ -584,10 +594,12 @@ impl<'a> AstNode<'a> for ForExpr<'a> { } impl<'a> ast::LoopBodyOwner<'a> for ForExpr<'a> {} -impl<'a> ForExpr<'a> {pub fn pat(self) -> Option> { +impl<'a> ForExpr<'a> { + pub fn pat(self) -> Option> { super::child_opt(self) } -pub fn iterable(self) -> Option> { + + pub fn iterable(self) -> Option> { super::child_opt(self) } } @@ -626,7 +638,8 @@ impl<'a> AstNode<'a> for IfExpr<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> IfExpr<'a> {pub fn condition(self) -> Option> { +impl<'a> IfExpr<'a> { + pub fn condition(self) -> Option> { super::child_opt(self) } } @@ -739,10 +752,12 @@ impl<'a> AstNode<'a> for LambdaExpr<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> LambdaExpr<'a> {pub fn param_list(self) -> Option> { +impl<'a> LambdaExpr<'a> { + pub fn param_list(self) -> Option> { super::child_opt(self) } -pub fn body(self) -> Option> { + + pub fn body(self) -> Option> { super::child_opt(self) } } @@ -763,10 +778,12 @@ impl<'a> AstNode<'a> for LetStmt<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> LetStmt<'a> {pub fn pat(self) -> Option> { +impl<'a> LetStmt<'a> { + pub fn pat(self) -> Option> { super::child_opt(self) } -pub fn initializer(self) -> Option> { + + pub fn initializer(self) -> Option> { super::child_opt(self) } } @@ -805,7 +822,8 @@ impl<'a> AstNode<'a> for LifetimeParam<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> LifetimeParam<'a> {pub fn lifetime(self) -> Option> { +impl<'a> LifetimeParam<'a> { + pub fn lifetime(self) -> Option> { super::child_opt(self) } } @@ -867,10 +885,12 @@ impl<'a> MatchArm<'a> { pub fn pats(self) -> impl Iterator> + 'a { super::children(self) } -pub fn guard(self) -> Option> { + + pub fn guard(self) -> Option> { super::child_opt(self) } -pub fn expr(self) -> Option> { + + pub fn expr(self) -> Option> { super::child_opt(self) } } @@ -913,10 +933,12 @@ impl<'a> AstNode<'a> for MatchExpr<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> MatchExpr<'a> {pub fn expr(self) -> Option> { +impl<'a> MatchExpr<'a> { + pub fn expr(self) -> Option> { super::child_opt(self) } -pub fn match_arm_list(self) -> Option> { + + pub fn match_arm_list(self) -> Option> { super::child_opt(self) } } @@ -956,7 +978,8 @@ impl<'a> AstNode<'a> for MethodCallExpr<'a> { } impl<'a> ast::ArgListOwner<'a> for MethodCallExpr<'a> {} -impl<'a> MethodCallExpr<'a> {pub fn expr(self) -> Option> { +impl<'a> MethodCallExpr<'a> { + pub fn expr(self) -> Option> { super::child_opt(self) } } @@ -979,7 +1002,8 @@ impl<'a> AstNode<'a> for Module<'a> { impl<'a> ast::NameOwner<'a> for Module<'a> {} impl<'a> ast::AttrsOwner<'a> for Module<'a> {} -impl<'a> Module<'a> {pub fn item_list(self) -> Option> { +impl<'a> Module<'a> { + pub fn item_list(self) -> Option> { super::child_opt(self) } } @@ -1190,7 +1214,8 @@ impl<'a> AstNode<'a> for Param<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> Param<'a> {pub fn pat(self) -> Option> { +impl<'a> Param<'a> { + pub fn pat(self) -> Option> { super::child_opt(self) } } @@ -1215,7 +1240,8 @@ impl<'a> ParamList<'a> { pub fn params(self) -> impl Iterator> + 'a { super::children(self) } -pub fn self_param(self) -> Option> { + + pub fn self_param(self) -> Option> { super::child_opt(self) } } @@ -1321,7 +1347,8 @@ impl<'a> AstNode<'a> for Path<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> Path<'a> {pub fn segment(self) -> Option> { +impl<'a> Path<'a> { + pub fn segment(self) -> Option> { super::child_opt(self) } } @@ -1378,7 +1405,8 @@ impl<'a> AstNode<'a> for PathSegment<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> PathSegment<'a> {pub fn name_ref(self) -> Option> { +impl<'a> PathSegment<'a> { + pub fn name_ref(self) -> Option> { super::child_opt(self) } } @@ -2052,7 +2080,8 @@ impl<'a> AstNode<'a> for UseItem<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> UseItem<'a> {pub fn use_tree(self) -> Option> { +impl<'a> UseItem<'a> { + pub fn use_tree(self) -> Option> { super::child_opt(self) } } @@ -2073,10 +2102,12 @@ impl<'a> AstNode<'a> for UseTree<'a> { fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } } -impl<'a> UseTree<'a> {pub fn path(self) -> Option> { +impl<'a> UseTree<'a> { + pub fn path(self) -> Option> { super::child_opt(self) } -pub fn use_tree_list(self) -> Option> { + + pub fn use_tree_list(self) -> Option> { super::child_opt(self) } } @@ -2138,7 +2169,8 @@ impl<'a> AstNode<'a> for WhileExpr<'a> { } impl<'a> ast::LoopBodyOwner<'a> for WhileExpr<'a> {} -impl<'a> WhileExpr<'a> {pub fn condition(self) -> Option> { +impl<'a> WhileExpr<'a> { + pub fn condition(self) -> Option> { super::child_opt(self) } } -- cgit v1.2.3