From 7c6f0f9128665c1a605caaa552347b936578f952 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 7 Jan 2018 15:34:11 +0300 Subject: G: shebang --- src/parser/event_parser/grammar.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/parser/event_parser') diff --git a/src/parser/event_parser/grammar.rs b/src/parser/event_parser/grammar.rs index e1f717714..f26cbc4f6 100644 --- a/src/parser/event_parser/grammar.rs +++ b/src/parser/event_parser/grammar.rs @@ -6,7 +6,7 @@ use syntax_kinds::*; pub fn file(p: &mut Parser) { node(p, FILE, |p| { - shebang(p); + p.optional(SHEBANG); inner_attributes(p); many(p, |p| { skip_to_first( @@ -17,11 +17,6 @@ pub fn file(p: &mut Parser) { }) } - -fn shebang(_: &mut Parser) { - //TODO -} - fn inner_attributes(_: &mut Parser) { //TODO } @@ -136,4 +131,10 @@ impl<'p> Parser<'p> { false } } + + pub(crate) fn optional(&mut self, kind: SyntaxKind) { + if self.current_is(kind) { + self.bump(); + } + } } \ No newline at end of file -- cgit v1.2.3