diff options
Diffstat (limited to 'crates/ra_parser/src/parser.rs')
-rw-r--r-- | crates/ra_parser/src/parser.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_parser/src/parser.rs b/crates/ra_parser/src/parser.rs index ccacaacad..d8567e84b 100644 --- a/crates/ra_parser/src/parser.rs +++ b/crates/ra_parser/src/parser.rs | |||
@@ -170,6 +170,12 @@ impl<'t> Parser<'t> { | |||
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | /// Advances the parser by one token, asserting that it is exactly the expected token | ||
174 | pub(crate) fn bump(&mut self, expected: SyntaxKind) { | ||
175 | debug_assert!(self.nth(0) == expected); | ||
176 | self.bump_any() | ||
177 | } | ||
178 | |||
173 | /// Advances the parser by one token, remapping its kind. | 179 | /// Advances the parser by one token, remapping its kind. |
174 | /// This is useful to create contextual keywords from | 180 | /// This is useful to create contextual keywords from |
175 | /// identifiers. For example, the lexer creates an `union` | 181 | /// identifiers. For example, the lexer creates an `union` |