aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast/mod.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-11 07:55:32 +0100
committerAleksey Kladov <[email protected]>2018-08-11 07:55:32 +0100
commitb18d2882f4f05078abfcf0595d08c226860de6c3 (patch)
tree247e87f3f8e03cec063d29dd6223e7727dadadb4 /crates/libsyntax2/src/ast/mod.rs
parent7581984601b35c113c4bcdf0f8b402b2635be0dc (diff)
Generate accessors
Diffstat (limited to 'crates/libsyntax2/src/ast/mod.rs')
-rw-r--r--crates/libsyntax2/src/ast/mod.rs13
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
33impl<R: TreeRoot> Function<R> { 27impl<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()