aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/parser_impl/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/parser_impl/event.rs')
-rw-r--r--crates/ra_syntax/src/parser_impl/event.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/parser_impl/event.rs b/crates/ra_syntax/src/parser_impl/event.rs
index 79fa21389..bf9c1cef0 100644
--- a/crates/ra_syntax/src/parser_impl/event.rs
+++ b/crates/ra_syntax/src/parser_impl/event.rs
@@ -13,6 +13,11 @@ use crate::{
13 SmolStr, 13 SmolStr,
14 SyntaxKind::{self, *}, 14 SyntaxKind::{self, *},
15 TextRange, TextUnit, 15 TextRange, TextUnit,
16 yellow::syntax_error::{
17 ParseError,
18 SyntaxError,
19 SyntaxErrorKind,
20 },
16}; 21};
17use std::mem; 22use std::mem;
18 23
@@ -75,7 +80,7 @@ pub(crate) enum Event {
75 }, 80 },
76 81
77 Error { 82 Error {
78 msg: String, 83 msg: ParseError,
79 }, 84 },
80} 85}
81 86
@@ -157,7 +162,10 @@ impl<'a, S: Sink> EventProcessor<'a, S> {
157 .sum::<TextUnit>(); 162 .sum::<TextUnit>();
158 self.leaf(kind, len, n_raw_tokens); 163 self.leaf(kind, len, n_raw_tokens);
159 } 164 }
160 Event::Error { msg } => self.sink.error(msg, self.text_pos), 165 Event::Error { msg } => self.sink.error(SyntaxError::new(
166 SyntaxErrorKind::ParseError(msg),
167 self.text_pos,
168 )),
161 } 169 }
162 } 170 }
163 self.sink 171 self.sink