aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/event.rs')
-rw-r--r--src/parser/event.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parser/event.rs b/src/parser/event.rs
index ac8a55de9..0fbfaeb9f 100644
--- a/src/parser/event.rs
+++ b/src/parser/event.rs
@@ -1,5 +1,5 @@
1use { 1use {
2 ErrorMsg, File, FileBuilder, Sink, SyntaxKind, Token, 2 ErrorMsg, File, FileBuilder, Sink, SyntaxKind, Token, GreenBuilder,
3 syntax_kinds::TOMBSTONE, 3 syntax_kinds::TOMBSTONE,
4}; 4};
5use super::is_insignificant; 5use super::is_insignificant;
@@ -69,6 +69,11 @@ pub(crate) enum Event {
69 69
70pub(super) fn to_file(text: String, tokens: &[Token], events: Vec<Event>) -> File { 70pub(super) fn to_file(text: String, tokens: &[Token], events: Vec<Event>) -> File {
71 let mut builder = FileBuilder::new(text); 71 let mut builder = FileBuilder::new(text);
72 process(&mut builder, tokens, events);
73 builder.finish()
74}
75
76pub(super) fn process(builder: &mut Sink, tokens: &[Token], events: Vec<Event>) {
72 let mut idx = 0; 77 let mut idx = 0;
73 78
74 let mut holes = Vec::new(); 79 let mut holes = Vec::new();
@@ -145,5 +150,4 @@ pub(super) fn to_file(text: String, tokens: &[Token], events: Vec<Event>) -> Fil
145 &Event::Error { ref msg } => builder.error(ErrorMsg { msg: msg.clone() }), 150 &Event::Error { ref msg } => builder.error(ErrorMsg { msg: msg.clone() }),
146 } 151 }
147 } 152 }
148 builder.finish()
149} 153}