diff options
author | Aleksey Kladov <[email protected]> | 2018-08-01 08:40:07 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-01 08:40:07 +0100 |
commit | 966e9db2b83802dfb55d55bd3a26e69dced1bbd7 (patch) | |
tree | 6d3bda084eab1221bcad7602aa26a2c307850a72 /src/yellow/builder.rs | |
parent | b9189ed2db8cb1934e677a17fcc6282c66306df1 (diff) |
Extract libeditor
Diffstat (limited to 'src/yellow/builder.rs')
-rw-r--r-- | src/yellow/builder.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/yellow/builder.rs b/src/yellow/builder.rs index b68ba789e..dbe646cd7 100644 --- a/src/yellow/builder.rs +++ b/src/yellow/builder.rs | |||
@@ -4,20 +4,18 @@ use { | |||
4 | SyntaxKind, TextRange, TextUnit, | 4 | SyntaxKind, TextRange, TextUnit, |
5 | }; | 5 | }; |
6 | 6 | ||
7 | pub(crate) struct GreenBuilder { | 7 | pub(crate) struct GreenBuilder<'a> { |
8 | text: String, | 8 | text: &'a str, |
9 | stack: Vec<GreenNodeBuilder>, | 9 | stack: Vec<GreenNodeBuilder>, |
10 | pos: TextUnit, | 10 | pos: TextUnit, |
11 | root: Option<GreenNode>, | 11 | root: Option<GreenNode>, |
12 | errors: Vec<SyntaxError>, | 12 | errors: Vec<SyntaxError>, |
13 | } | 13 | } |
14 | 14 | ||
15 | impl GreenBuilder {} | 15 | impl<'a> Sink<'a> for GreenBuilder<'a> { |
16 | |||
17 | impl Sink for GreenBuilder { | ||
18 | type Tree = SyntaxNode; | 16 | type Tree = SyntaxNode; |
19 | 17 | ||
20 | fn new(text: String) -> Self { | 18 | fn new(text: &'a str) -> Self { |
21 | GreenBuilder { | 19 | GreenBuilder { |
22 | text, | 20 | text, |
23 | stack: Vec::new(), | 21 | stack: Vec::new(), |