* Expect `token'. */
| 391 | * Expect `token'. |
| 392 | */ |
| 393 | static void expectToken(Parser &parser, char token) |
| 394 | { |
| 395 | char got = getToken(parser); |
| 396 | if (got == token) |
| 397 | return; |
| 398 | if (parser.isPipe() && token == EOF) |
| 399 | exit(EXIT_FAILURE); |
| 400 | parse_error(parser, "failed to parse JSON message; expected token `%s', " |
| 401 | "got token `%s'", getTokenName(token), getTokenName(got)); |
| 402 | } |
| 403 | |
| 404 | /* |
| 405 | * Expect `token1' or `token2'. |
no test coverage detected