diff options
author | Aleksey Kladov <[email protected]> | 2018-07-29 13:16:07 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-07-29 13:16:07 +0100 |
commit | 415c891d641fa305e7ddbbbcc78db990dd5d3564 (patch) | |
tree | 4b6e1e0aa4b5a732aeae8945e75c9bee3bbf1d65 /src/yellow/syntax.rs | |
parent | ad188d4c3db34f035408afbdd6d2f3c308121f0a (diff) |
Reorganize
Diffstat (limited to 'src/yellow/syntax.rs')
-rw-r--r-- | src/yellow/syntax.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/yellow/syntax.rs b/src/yellow/syntax.rs index 7b1a05cd9..78fa5bf95 100644 --- a/src/yellow/syntax.rs +++ b/src/yellow/syntax.rs | |||
@@ -4,7 +4,8 @@ use std::{ | |||
4 | }; | 4 | }; |
5 | 5 | ||
6 | use { | 6 | use { |
7 | TextRange, TextUnit, SyntaxKind, | 7 | TextRange, TextUnit, |
8 | SyntaxKind::{self, *}, | ||
8 | yellow::{Ptr, RedNode, GreenNode, TextLen}, | 9 | yellow::{Ptr, RedNode, GreenNode, TextLen}, |
9 | }; | 10 | }; |
10 | 11 | ||
@@ -18,17 +19,17 @@ pub struct SyntaxNode { | |||
18 | #[derive(Clone)] | 19 | #[derive(Clone)] |
19 | pub struct SyntaxRoot { | 20 | pub struct SyntaxRoot { |
20 | red: Arc<RedNode>, | 21 | red: Arc<RedNode>, |
21 | pub(crate) errors: Arc<Vec<SError>>, | 22 | pub(crate) errors: Arc<Vec<SyntaxError>>, |
22 | } | 23 | } |
23 | 24 | ||
24 | #[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd)] | 25 | #[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd)] |
25 | pub(crate) struct SError { | 26 | pub(crate) struct SyntaxError { |
26 | pub(crate) message: String, | 27 | pub(crate) message: String, |
27 | pub(crate) offset: TextUnit, | 28 | pub(crate) offset: TextUnit, |
28 | } | 29 | } |
29 | 30 | ||
30 | impl SyntaxNode { | 31 | impl SyntaxNode { |
31 | pub(crate) fn new(root: Arc<GreenNode>, errors: Vec<SError>) -> SyntaxNode { | 32 | pub(crate) fn new(root: Arc<GreenNode>, errors: Vec<SyntaxError>) -> SyntaxNode { |
32 | let root = Arc::new(RedNode::new_root(root)); | 33 | let root = Arc::new(RedNode::new_root(root)); |
33 | let red = Ptr::new(&root); | 34 | let red = Ptr::new(&root); |
34 | let root = SyntaxRoot { red: root, errors: Arc::new(errors) }; | 35 | let root = SyntaxRoot { red: root, errors: Arc::new(errors) }; |
@@ -123,7 +124,6 @@ impl fmt::Debug for SyntaxNode { | |||
123 | } | 124 | } |
124 | 125 | ||
125 | fn has_short_text(kind: SyntaxKind) -> bool { | 126 | fn has_short_text(kind: SyntaxKind) -> bool { |
126 | use syntax_kinds::*; | ||
127 | match kind { | 127 | match kind { |
128 | IDENT | LIFETIME => true, | 128 | IDENT | LIFETIME => true, |
129 | _ => false, | 129 | _ => false, |