| 545 | void advance() { token_ = lexer_.next(); } |
| 546 | |
| 547 | Token expect(Tok kind, const char* description = nullptr) { |
| 548 | if (token_.kind != kind) { |
| 549 | fail("expected " + std::string(description ? description : tokenName(kind)) + |
| 550 | ", got '" + token_.text + "'"); |
| 551 | } |
| 552 | Token result = token_; |
| 553 | advance(); |
| 554 | return result; |
| 555 | } |
| 556 | |
| 557 | static const char* tokenName(Tok kind) { |
| 558 | switch (kind) { |
nothing calls this directly
no outgoing calls
no test coverage detected