diff options
author | Aleksey Kladov <[email protected]> | 2018-08-11 07:55:32 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-11 07:55:32 +0100 |
commit | b18d2882f4f05078abfcf0595d08c226860de6c3 (patch) | |
tree | 247e87f3f8e03cec063d29dd6223e7727dadadb4 /crates/libsyntax2/src/ast/mod.rs | |
parent | 7581984601b35c113c4bcdf0f8b402b2635be0dc (diff) |
Generate accessors
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() |