diff options
Diffstat (limited to 'crates/ra_syntax/src/parser_impl/event.rs')
-rw-r--r-- | crates/ra_syntax/src/parser_impl/event.rs | 11 |
1 files changed, 9 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..ced09bcff 100644 --- a/crates/ra_syntax/src/parser_impl/event.rs +++ b/crates/ra_syntax/src/parser_impl/event.rs | |||
@@ -13,6 +13,10 @@ 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 | SyntaxErrorKind, | ||
19 | }, | ||
16 | }; | 20 | }; |
17 | use std::mem; | 21 | use std::mem; |
18 | 22 | ||
@@ -75,7 +79,7 @@ pub(crate) enum Event { | |||
75 | }, | 79 | }, |
76 | 80 | ||
77 | Error { | 81 | Error { |
78 | msg: String, | 82 | msg: ParseError, |
79 | }, | 83 | }, |
80 | } | 84 | } |
81 | 85 | ||
@@ -157,7 +161,10 @@ impl<'a, S: Sink> EventProcessor<'a, S> { | |||
157 | .sum::<TextUnit>(); | 161 | .sum::<TextUnit>(); |
158 | self.leaf(kind, len, n_raw_tokens); | 162 | self.leaf(kind, len, n_raw_tokens); |
159 | } | 163 | } |
160 | Event::Error { msg } => self.sink.error(msg, self.text_pos), | 164 | Event::Error { msg } => self.sink.error( |
165 | SyntaxErrorKind::ParseError(msg), | ||
166 | TextRange::offset_len(self.text_pos, 1.into()), | ||
167 | ), | ||
161 | } | 168 | } |
162 | } | 169 | } |
163 | self.sink | 170 | self.sink |