TOK_RE: [A-Za-z_$][\w$]* (whole identifier) */
| 527 | |
| 528 | /* TOK_RE: [A-Za-z_$][\w$]* (whole identifier) */ |
| 529 | static int tok_at(const uint32_t *t, int n, int p) { |
| 530 | if (p > 0) { |
| 531 | uint32_t b = t[p - 1]; |
| 532 | if (pdf_u_word(b) || b == '.' || b == '$' || b == '@' || b == '/' || b == '-') { |
| 533 | return -1; |
| 534 | } |
| 535 | } |
| 536 | if (!ident_start(t[p])) { |
| 537 | return -1; |
| 538 | } |
| 539 | int q = p + 1; |
| 540 | while (q < n && ident_cont(t[q])) { |
| 541 | q++; |
| 542 | } |
| 543 | return q; |
| 544 | } |
| 545 | |
| 546 | static uint32_t ascii_lower(uint32_t c) { |
| 547 | return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c; |
no test coverage detected