aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser/grammar/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/event_parser/grammar/mod.rs')
-rw-r--r--src/parser/event_parser/grammar/mod.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/parser/event_parser/grammar/mod.rs b/src/parser/event_parser/grammar/mod.rs
index 6d1cd7ec3..60458ce70 100644
--- a/src/parser/event_parser/grammar/mod.rs
+++ b/src/parser/event_parser/grammar/mod.rs
@@ -6,10 +6,11 @@ use syntax_kinds::*;
6mod items; 6mod items;
7mod attributes; 7mod attributes;
8mod expressions; 8mod expressions;
9mod paths;
9 10
10pub(crate) fn file(p: &mut Parser) { 11pub(crate) fn file(p: &mut Parser) {
11 node(p, FILE, |p| { 12 node(p, FILE, |p| {
12 p.optional(SHEBANG); 13 p.eat(SHEBANG);
13 items::mod_contents(p); 14 items::mod_contents(p);
14 }) 15 })
15} 16}
@@ -99,12 +100,6 @@ impl<'p> Parser<'p> {
99 } 100 }
100 } 101 }
101 102
102 fn optional(&mut self, kind: SyntaxKind) {
103 if self.current() == kind {
104 self.bump();
105 }
106 }
107
108 fn eat(&mut self, kind: SyntaxKind) -> bool { 103 fn eat(&mut self, kind: SyntaxKind) -> bool {
109 self.current() == kind && { self.bump(); true } 104 self.current() == kind && { self.bump(); true }
110 } 105 }