aboutsummaryrefslogtreecommitdiff
path: root/src/ast
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-09 15:44:40 +0100
committerAleksey Kladov <[email protected]>2018-08-09 15:54:49 +0100
commitafa94d4f37b9a0a1e723edffcc79c3d48799bad1 (patch)
treeea4a5163bee5f202c3627b88280e74a704c186d0 /src/ast
parentd8b2a5efc0e5de3b0d72f29ccc86185f0827c9d3 (diff)
fn_item -> function
Diffstat (limited to 'src/ast')
-rw-r--r--src/ast/generated.rs6
-rw-r--r--src/ast/mod.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/ast/generated.rs b/src/ast/generated.rs
index 612b04f86..b93c76d0c 100644
--- a/src/ast/generated.rs
+++ b/src/ast/generated.rs
@@ -22,14 +22,14 @@ impl<R: TreeRoot> AstNode<R> for File<R> {
22 22
23 23
24#[derive(Debug)] 24#[derive(Debug)]
25pub struct FnItem<R: TreeRoot = Arc<SyntaxRoot>> { 25pub struct Function<R: TreeRoot = Arc<SyntaxRoot>> {
26 syntax: SyntaxNode<R>, 26 syntax: SyntaxNode<R>,
27} 27}
28 28
29impl<R: TreeRoot> AstNode<R> for FnItem<R> { 29impl<R: TreeRoot> AstNode<R> for Function<R> {
30 fn cast(syntax: SyntaxNode<R>) -> Option<Self> { 30 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
31 match syntax.kind() { 31 match syntax.kind() {
32 FN_ITEM => Some(FnItem { syntax }), 32 FUNCTION => Some(Function { syntax }),
33 _ => None, 33 _ => None,
34 } 34 }
35 } 35 }
diff --git a/src/ast/mod.rs b/src/ast/mod.rs
index dc7e006c9..317ed4f45 100644
--- a/src/ast/mod.rs
+++ b/src/ast/mod.rs
@@ -19,14 +19,14 @@ impl File<Arc<SyntaxRoot>> {
19} 19}
20 20
21impl<R: TreeRoot> File<R> { 21impl<R: TreeRoot> File<R> {
22 pub fn functions<'a>(&'a self) -> impl Iterator<Item = FnItem<R>> + 'a { 22 pub fn functions<'a>(&'a self) -> impl Iterator<Item = Function<R>> + 'a {
23 self.syntax() 23 self.syntax()
24 .children() 24 .children()
25 .filter_map(FnItem::cast) 25 .filter_map(Function::cast)
26 } 26 }
27} 27}
28 28
29impl<R: TreeRoot> FnItem<R> { 29impl<R: TreeRoot> Function<R> {
30 pub fn name(&self) -> Option<Name<R>> { 30 pub fn name(&self) -> Option<Name<R>> {
31 self.syntax() 31 self.syntax()
32 .children() 32 .children()