diff options
Diffstat (limited to 'src/ast.rs')
-rw-r--r-- | src/ast.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ast.rs b/src/ast.rs index b513eb13e..48e1d23ac 100644 --- a/src/ast.rs +++ b/src/ast.rs | |||
@@ -1,14 +1,16 @@ | |||
1 | use std::sync::Arc; | 1 | use std::sync::Arc; |
2 | use {SyntaxNode, TreeRoot, SyntaxRoot}; | 2 | use {SyntaxNode, SyntaxRoot, TreeRoot}; |
3 | 3 | ||
4 | #[derive(Debug)] | 4 | #[derive(Debug)] |
5 | pub struct File<R: TreeRoot = Arc<SyntaxRoot>> { | 5 | pub struct File<R: TreeRoot = Arc<SyntaxRoot>> { |
6 | syntax: SyntaxNode<R> | 6 | syntax: SyntaxNode<R>, |
7 | } | 7 | } |
8 | 8 | ||
9 | impl File<Arc<SyntaxRoot>> { | 9 | impl File<Arc<SyntaxRoot>> { |
10 | pub fn parse(text: &str) -> Self { | 10 | pub fn parse(text: &str) -> Self { |
11 | File { syntax: ::parse(text.to_owned()) } | 11 | File { |
12 | syntax: ::parse(text.to_owned()), | ||
13 | } | ||
12 | } | 14 | } |
13 | } | 15 | } |
14 | 16 | ||