Checks whether tokens are equal (same text). */
| 341 | |
| 342 | /** Checks whether tokens are equal (same text). */ |
| 343 | int token_eq(jsmntok_t *tok1, jsmntok_t *tok2) { |
| 344 | int len1 = tok1->end - tok1->start; |
| 345 | int len2 = tok2->end - tok2->start; |
| 346 | return len1 == len2 |
| 347 | && !strncmp(input + tok1->start, input + tok2->start, len1); |
| 348 | } |
| 349 | |
| 350 | static void error(jsmntok_t *tok, const char *msg) |
| 351 | { |