aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast/generated.rs.tera
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/ast/generated.rs.tera')
-rw-r--r--crates/libsyntax2/src/ast/generated.rs.tera26
1 files changed, 21 insertions, 5 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs.tera b/crates/libsyntax2/src/ast/generated.rs.tera
index afce068c8..86de7bce8 100644
--- a/crates/libsyntax2/src/ast/generated.rs.tera
+++ b/crates/libsyntax2/src/ast/generated.rs.tera
@@ -21,13 +21,29 @@ impl<R: TreeRoot> AstNode<R> for {{ Name }}<R> {
21} 21}
22 22
23impl<R: TreeRoot> {{ Name }}<R> { 23impl<R: TreeRoot> {{ Name }}<R> {
24{% for (method_name, kind) in node.opts %} 24{%- if node.collections -%}
25{% set ChildName = kind | camel %} 25{%- for m in node.collections -%}
26 pub fn {{ method_name }}<'a>(&'a self) -> impl Iterator<Item = {{ ChildKind }}<R>> + 'a { 26{%- set method_name = m.0 -%}
27{%- set ChildName = m.1 | camel %}
28 pub fn {{ method_name }}<'a>(&'a self) -> impl Iterator<Item = {{ ChildName }}<R>> + 'a {
27 self.syntax() 29 self.syntax()
28 .children() 30 .children()
29 .filter_map({{ ChildKind }}::cast) 31 .filter_map({{ ChildName }}::cast)
30 } 32 }
31{% endfor %} 33{% endfor -%}
34{%- endif -%}
35
36{%- if node.options -%}
37{%- for m in node.options -%}
38{%- set method_name = m.0 -%}
39{%- set ChildName = m.1 | camel %}
40 pub fn {{ method_name }}(&self) -> Option<{{ ChildName }}<R>> {
41 self.syntax()
42 .children()
43 .filter_map({{ ChildName }}::cast)
44 .next()
45 }
46{% endfor -%}
47{%- endif -%}
32} 48}
33{% endfor %} 49{% endfor %}