If the next token is a `want`, consume it, otherwise do nothing.
(&mut self, want: Token<'a>)
| 541 | |
| 542 | // If the next token is a `want`, consume it, otherwise do nothing. |
| 543 | fn optional(&mut self, want: Token<'a>) -> bool { |
| 544 | if self.token() == Some(want) { |
| 545 | self.consume(); |
| 546 | true |
| 547 | } else { |
| 548 | false |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | // Match and consume a specific identifier string. |
| 553 | // Used for pseudo-keywords like "stack_slot" that only appear in certain contexts. |
no test coverage detected