aboutsummaryrefslogtreecommitdiff
path: root/src/tree/file_builder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tree/file_builder.rs')
-rw-r--r--src/tree/file_builder.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tree/file_builder.rs b/src/tree/file_builder.rs
index da8b8f824..83aa4186f 100644
--- a/src/tree/file_builder.rs
+++ b/src/tree/file_builder.rs
@@ -1,5 +1,5 @@
1use {SyntaxKind, TextUnit, TextRange}; 1use {SyntaxKind, TextUnit, TextRange};
2use super::{NodeData, NodeIdx, File}; 2use super::{NodeData, SyntaxErrorData, NodeIdx, File};
3 3
4pub trait Sink { 4pub trait Sink {
5 fn leaf(&mut self, kind: SyntaxKind, len: TextUnit); 5 fn leaf(&mut self, kind: SyntaxKind, len: TextUnit);
@@ -11,6 +11,7 @@ pub trait Sink {
11pub struct FileBuilder { 11pub struct FileBuilder {
12 text: String, 12 text: String,
13 nodes: Vec<NodeData>, 13 nodes: Vec<NodeData>,
14 errors: Vec<SyntaxErrorData>,
14 in_progress: Vec<(NodeIdx, Option<NodeIdx>)>, // (parent, last_child) 15 in_progress: Vec<(NodeIdx, Option<NodeIdx>)>, // (parent, last_child)
15 pos: TextUnit, 16 pos: TextUnit,
16} 17}
@@ -58,6 +59,7 @@ impl FileBuilder {
58 FileBuilder { 59 FileBuilder {
59 text, 60 text,
60 nodes: Vec::new(), 61 nodes: Vec::new(),
62 errors: Vec::new(),
61 in_progress: Vec::new(), 63 in_progress: Vec::new(),
62 pos: TextUnit::new(0), 64 pos: TextUnit::new(0),
63 } 65 }
@@ -75,6 +77,7 @@ impl FileBuilder {
75 File { 77 File {
76 text: self.text, 78 text: self.text,
77 nodes: self.nodes, 79 nodes: self.nodes,
80 errors: self.errors,
78 } 81 }
79 } 82 }
80 83