diff options
author | Aleksey Kladov <[email protected]> | 2018-01-09 20:32:18 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-01-09 20:32:18 +0000 |
commit | 5ea7e5fb7ab9f9ed762c8b5220ba01a29796a871 (patch) | |
tree | e67b91e3fe1d046d886bce5e896bb045e327169e /src/parser/event_parser/grammar/mod.rs | |
parent | 1544e89c49c67df00fc72d841f3e39be792cbe2b (diff) |
G: simplest use items
Diffstat (limited to 'src/parser/event_parser/grammar/mod.rs')
-rw-r--r-- | src/parser/event_parser/grammar/mod.rs | 9 |
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::*; | |||
6 | mod items; | 6 | mod items; |
7 | mod attributes; | 7 | mod attributes; |
8 | mod expressions; | 8 | mod expressions; |
9 | mod paths; | ||
9 | 10 | ||
10 | pub(crate) fn file(p: &mut Parser) { | 11 | pub(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 | } |