Checks whether token is string or number literal. */
| 365 | |
| 366 | /** Checks whether token is string or number literal. */ |
| 367 | static void expect_nodeid(jsmntok_t *tok) |
| 368 | { |
| 369 | /* Note: being an integer as opposed to float is not checked! */ |
| 370 | if (!(tok->type == JSMN_STRING && !tok->size || |
| 371 | tok->type == JSMN_PRIMITIVE && isdigit(input[tok->start]))) |
| 372 | error(tok, "string or integer literal"); |
| 373 | } |
| 374 | |
| 375 | /** Checks whether token is a false or true literal. */ |
| 376 | static void expect_bool(jsmntok_t *tok) |