diff options
Diffstat (limited to 'src/parser/event_parser/parser.rs')
-rw-r--r-- | src/parser/event_parser/parser.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/parser/event_parser/parser.rs b/src/parser/event_parser/parser.rs index 2d5418a29..36452ef67 100644 --- a/src/parser/event_parser/parser.rs +++ b/src/parser/event_parser/parser.rs | |||
@@ -69,6 +69,15 @@ impl<'t> Parser<'t> { | |||
69 | Some(kind) | 69 | Some(kind) |
70 | } | 70 | } |
71 | 71 | ||
72 | pub(crate) fn expect(&mut self, kind: SyntaxKind) -> Result<(), ()> { | ||
73 | if kind == self.current().ok_or(())? { | ||
74 | self.bump(); | ||
75 | Ok(()) | ||
76 | } else { | ||
77 | Err(()) | ||
78 | } | ||
79 | } | ||
80 | |||
72 | fn event(&mut self, event: Event) { | 81 | fn event(&mut self, event: Event) { |
73 | self.events.push(event) | 82 | self.events.push(event) |
74 | } | 83 | } |