Consume the current token if it is of the given kind. Returns `true` if it matches, `false` otherwise.
(&mut self, kind: TokenKind)
| 376 | /// Consume the current token if it is of the given kind. Returns `true` if it matches, `false` |
| 377 | /// otherwise. |
| 378 | fn eat(&mut self, kind: TokenKind) -> bool { |
| 379 | if self.at(kind) { |
| 380 | self.do_bump(kind); |
| 381 | true |
| 382 | } else { |
| 383 | false |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | /// Eat the current token if its of the expected kind, otherwise adds an appropriate error. |
| 388 | fn expect(&mut self, expected: TokenKind) -> bool { |
no test coverage detected