aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser/grammar/mod.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-01-27 21:05:31 +0000
committerAleksey Kladov <[email protected]>2018-01-27 21:05:31 +0000
commitcaba13a2dd1f3514ced3fbc2d4966def644f5ad8 (patch)
tree569d8a69fc7feb6ea36af3d1dbcf684c5f06c327 /src/parser/event_parser/grammar/mod.rs
parentd280c72338313ed7d900a9dad05923d344b5fa86 (diff)
Simplify
Diffstat (limited to 'src/parser/event_parser/grammar/mod.rs')
-rw-r--r--src/parser/event_parser/grammar/mod.rs9
1 files changed, 9 insertions, 0 deletions
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> {
84 l.is_ahead(self) 84 l.is_ahead(self)
85 } 85 }
86 86
87 fn err_and_bump(&mut self, message: &str) {
88 let err = self.start();
89 self.error()
90 .message(message)
91 .emit();
92 self.bump();
93 err.complete(self, ERROR);
94 }
95
87 pub(crate) fn expect(&mut self, kind: SyntaxKind) -> bool { 96 pub(crate) fn expect(&mut self, kind: SyntaxKind) -> bool {
88 if self.at(kind) { 97 if self.at(kind) {
89 self.bump(); 98 self.bump();