aboutsummaryrefslogtreecommitdiff
path: root/src/tree
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-28 11:07:10 +0100
committerAleksey Kladov <[email protected]>2018-07-28 11:07:10 +0100
commit8d9961b75377a7bd2656b5aa1451710de8c86f60 (patch)
treec2dcedf487d2ad4674edb012dd579aa74173d8c2 /src/tree
parent52dc0ddc84544a59d3a2580d9944d0482a633349 (diff)
Migrate to text-unit
Diffstat (limited to 'src/tree')
-rw-r--r--src/tree/file_builder.rs6
-rw-r--r--src/tree/mod.rs8
2 files changed, 6 insertions, 8 deletions
diff --git a/src/tree/file_builder.rs b/src/tree/file_builder.rs
index f831676c7..712602168 100644
--- a/src/tree/file_builder.rs
+++ b/src/tree/file_builder.rs
@@ -31,7 +31,7 @@ impl Sink for FileBuilder {
31 fn leaf(&mut self, kind: SyntaxKind, len: TextUnit) { 31 fn leaf(&mut self, kind: SyntaxKind, len: TextUnit) {
32 let leaf = NodeData { 32 let leaf = NodeData {
33 kind, 33 kind,
34 range: TextRange::from_len(self.pos, len), 34 range: TextRange::offset_len(self.pos, len),
35 parent: None, 35 parent: None,
36 first_child: None, 36 first_child: None,
37 next_sibling: None, 37 next_sibling: None,
@@ -44,7 +44,7 @@ impl Sink for FileBuilder {
44 fn start_internal(&mut self, kind: SyntaxKind) { 44 fn start_internal(&mut self, kind: SyntaxKind) {
45 let node = NodeData { 45 let node = NodeData {
46 kind, 46 kind,
47 range: TextRange::from_len(self.pos, 0.into()), 47 range: TextRange::offset_len(self.pos, 0.into()),
48 parent: None, 48 parent: None,
49 first_child: None, 49 first_child: None,
50 next_sibling: None, 50 next_sibling: None,
@@ -83,7 +83,7 @@ impl FileBuilder {
83 nodes: Vec::new(), 83 nodes: Vec::new(),
84 errors: Vec::new(), 84 errors: Vec::new(),
85 in_progress: Vec::new(), 85 in_progress: Vec::new(),
86 pos: TextUnit::new(0), 86 pos: 0.into(),
87 } 87 }
88 } 88 }
89 89
diff --git a/src/tree/mod.rs b/src/tree/mod.rs
index ebf26777b..f7b16d7b5 100644
--- a/src/tree/mod.rs
+++ b/src/tree/mod.rs
@@ -1,9 +1,7 @@
1use text::{TextRange, TextUnit};
2
3use std::fmt;
4use std::cmp;
5
6mod file_builder; 1mod file_builder;
2
3use ::{TextRange, TextUnit};
4use std::{fmt, cmp};
7pub(crate) use self::file_builder::{ErrorMsg, FileBuilder, Sink}; 5pub(crate) use self::file_builder::{ErrorMsg, FileBuilder, Sink};
8 6
9pub use syntax_kinds::SyntaxKind; 7pub use syntax_kinds::SyntaxKind;