diff options
Diffstat (limited to 'crates/libsyntax2/src/ast')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs.tera | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs.tera b/crates/libsyntax2/src/ast/generated.rs.tera index 242837801..afce068c8 100644 --- a/crates/libsyntax2/src/ast/generated.rs.tera +++ b/crates/libsyntax2/src/ast/generated.rs.tera | |||
@@ -19,4 +19,15 @@ impl<R: TreeRoot> AstNode<R> for {{ Name }}<R> { | |||
19 | } | 19 | } |
20 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 20 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } |
21 | } | 21 | } |
22 | |||
23 | impl<R: TreeRoot> {{ Name }}<R> { | ||
24 | {% for (method_name, kind) in node.opts %} | ||
25 | {% set ChildName = kind | camel %} | ||
26 | pub fn {{ method_name }}<'a>(&'a self) -> impl Iterator<Item = {{ ChildKind }}<R>> + 'a { | ||
27 | self.syntax() | ||
28 | .children() | ||
29 | .filter_map({{ ChildKind }}::cast) | ||
30 | } | ||
31 | {% endfor %} | ||
32 | } | ||
22 | {% endfor %} | 33 | {% endfor %} |