diff options
Diffstat (limited to 'src/parser/event_parser/parser.rs')
-rw-r--r-- | src/parser/event_parser/parser.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/parser/event_parser/parser.rs b/src/parser/event_parser/parser.rs index d19663865..2507af6bf 100644 --- a/src/parser/event_parser/parser.rs +++ b/src/parser/event_parser/parser.rs | |||
@@ -136,13 +136,6 @@ impl<'t> Parser<'t> { | |||
136 | self.events | 136 | self.events |
137 | } | 137 | } |
138 | 138 | ||
139 | pub(crate) fn current(&self) -> SyntaxKind { | ||
140 | if self.pos == self.tokens.len() { | ||
141 | return EOF; | ||
142 | } | ||
143 | self.tokens[self.pos].kind | ||
144 | } | ||
145 | |||
146 | pub(crate) fn start(&mut self) -> Marker { | 139 | pub(crate) fn start(&mut self) -> Marker { |
147 | let m = Marker { | 140 | let m = Marker { |
148 | pos: self.events.len() as u32, | 141 | pos: self.events.len() as u32, |
@@ -175,6 +168,10 @@ impl<'t> Parser<'t> { | |||
175 | self.tokens.get(self.pos + n).map(|t| t.kind).unwrap_or(EOF) | 168 | self.tokens.get(self.pos + n).map(|t| t.kind).unwrap_or(EOF) |
176 | } | 169 | } |
177 | 170 | ||
171 | pub(crate) fn current(&self) -> SyntaxKind { | ||
172 | self.raw_lookahead(0) | ||
173 | } | ||
174 | |||
178 | fn event(&mut self, event: Event) { | 175 | fn event(&mut self, event: Event) { |
179 | self.events.push(event) | 176 | self.events.push(event) |
180 | } | 177 | } |