From caba13a2dd1f3514ced3fbc2d4966def644f5ad8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 28 Jan 2018 00:05:31 +0300 Subject: Simplify --- src/parser/event_parser/grammar/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/parser/event_parser/grammar/mod.rs') diff --git a/src/parser/event_parser/grammar/mod.rs b/src/parser/event_parser/grammar/mod.rs index 32e4db698..67773453b 100644 --- a/src/parser/event_parser/grammar/mod.rs +++ b/src/parser/event_parser/grammar/mod.rs @@ -84,6 +84,15 @@ impl<'p> Parser<'p> { l.is_ahead(self) } + fn err_and_bump(&mut self, message: &str) { + let err = self.start(); + self.error() + .message(message) + .emit(); + self.bump(); + err.complete(self, ERROR); + } + pub(crate) fn expect(&mut self, kind: SyntaxKind) -> bool { if self.at(kind) { self.bump(); -- cgit v1.2.3