aboutsummaryrefslogtreecommitdiff
path: root/src/yellow/syntax.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/yellow/syntax.rs')
-rw-r--r--src/yellow/syntax.rs10
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
6use { 6use {
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)]
19pub struct SyntaxRoot { 20pub 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)]
25pub(crate) struct SError { 26pub(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
30impl SyntaxNode { 31impl 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
125fn has_short_text(kind: SyntaxKind) -> bool { 126fn 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,