diff options
Diffstat (limited to 'src/ast')
-rw-r--r-- | src/ast/generated.rs | 6 | ||||
-rw-r--r-- | src/ast/mod.rs | 6 |
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)] |
25 | pub struct FnItem<R: TreeRoot = Arc<SyntaxRoot>> { | 25 | pub struct Function<R: TreeRoot = Arc<SyntaxRoot>> { |
26 | syntax: SyntaxNode<R>, | 26 | syntax: SyntaxNode<R>, |
27 | } | 27 | } |
28 | 28 | ||
29 | impl<R: TreeRoot> AstNode<R> for FnItem<R> { | 29 | impl<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 | ||
21 | impl<R: TreeRoot> File<R> { | 21 | impl<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 | ||
29 | impl<R: TreeRoot> FnItem<R> { | 29 | impl<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() |