diff options
Diffstat (limited to 'crates/ra_syntax/src/parser_impl/mod.rs')
-rw-r--r-- | crates/ra_syntax/src/parser_impl/mod.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/parser_impl/mod.rs b/crates/ra_syntax/src/parser_impl/mod.rs index 2b026d61e..cb6e370ac 100644 --- a/crates/ra_syntax/src/parser_impl/mod.rs +++ b/crates/ra_syntax/src/parser_impl/mod.rs | |||
@@ -10,7 +10,11 @@ use crate::{ | |||
10 | event::{Event, EventProcessor}, | 10 | event::{Event, EventProcessor}, |
11 | input::{InputPosition, ParserInput}, | 11 | input::{InputPosition, ParserInput}, |
12 | }, | 12 | }, |
13 | SmolStr, TextUnit, | 13 | SmolStr, |
14 | yellow::syntax_error::{ | ||
15 | ParseError, | ||
16 | SyntaxError, | ||
17 | }, | ||
14 | }; | 18 | }; |
15 | 19 | ||
16 | use crate::SyntaxKind::{self, EOF, TOMBSTONE}; | 20 | use crate::SyntaxKind::{self, EOF, TOMBSTONE}; |
@@ -21,7 +25,7 @@ pub(crate) trait Sink { | |||
21 | fn leaf(&mut self, kind: SyntaxKind, text: SmolStr); | 25 | fn leaf(&mut self, kind: SyntaxKind, text: SmolStr); |
22 | fn start_internal(&mut self, kind: SyntaxKind); | 26 | fn start_internal(&mut self, kind: SyntaxKind); |
23 | fn finish_internal(&mut self); | 27 | fn finish_internal(&mut self); |
24 | fn error(&mut self, message: String, offset: TextUnit); | 28 | fn error(&mut self, error: SyntaxError); |
25 | fn finish(self) -> Self::Tree; | 29 | fn finish(self) -> Self::Tree; |
26 | } | 30 | } |
27 | 31 | ||
@@ -144,7 +148,9 @@ impl<'t> ParserImpl<'t> { | |||
144 | } | 148 | } |
145 | 149 | ||
146 | pub(super) fn error(&mut self, msg: String) { | 150 | pub(super) fn error(&mut self, msg: String) { |
147 | self.event(Event::Error { msg }) | 151 | self.event(Event::Error { |
152 | msg: ParseError(msg), | ||
153 | }) | ||
148 | } | 154 | } |
149 | 155 | ||
150 | pub(super) fn complete(&mut self, pos: u32, kind: SyntaxKind) { | 156 | pub(super) fn complete(&mut self, pos: u32, kind: SyntaxKind) { |