diff options
Diffstat (limited to 'crates/libsyntax2/src/ast/mod.rs')
-rw-r--r-- | crates/libsyntax2/src/ast/mod.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/crates/libsyntax2/src/ast/mod.rs b/crates/libsyntax2/src/ast/mod.rs index eeb7ae6f6..7d3cdb93d 100644 --- a/crates/libsyntax2/src/ast/mod.rs +++ b/crates/libsyntax2/src/ast/mod.rs | |||
@@ -22,22 +22,9 @@ impl<R: TreeRoot> File<R> { | |||
22 | pub fn errors(&self) -> Vec<SyntaxError> { | 22 | pub fn errors(&self) -> Vec<SyntaxError> { |
23 | self.syntax().root.errors.clone() | 23 | self.syntax().root.errors.clone() |
24 | } | 24 | } |
25 | |||
26 | pub fn functions<'a>(&'a self) -> impl Iterator<Item = Function<R>> + 'a { | ||
27 | self.syntax() | ||
28 | .children() | ||
29 | .filter_map(Function::cast) | ||
30 | } | ||
31 | } | 25 | } |
32 | 26 | ||
33 | impl<R: TreeRoot> Function<R> { | 27 | impl<R: TreeRoot> Function<R> { |
34 | pub fn name(&self) -> Option<Name<R>> { | ||
35 | self.syntax() | ||
36 | .children() | ||
37 | .filter_map(Name::cast) | ||
38 | .next() | ||
39 | } | ||
40 | |||
41 | pub fn has_atom_attr(&self, atom: &str) -> bool { | 28 | pub fn has_atom_attr(&self, atom: &str) -> bool { |
42 | self.syntax() | 29 | self.syntax() |
43 | .children() | 30 | .children() |