MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / tok_at

Function tok_at

internal/cbm/doc_pdf.c:529–544  ·  view source on GitHub ↗

TOK_RE: [A-Za-z_$][\w$]* (whole identifier) */

Source from the content-addressed store, hash-verified

527
528/* TOK_RE: [A-Za-z_$][\w$]* (whole identifier) */
529static 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
546static uint32_t ascii_lower(uint32_t c) {
547 return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c;

Callers 1

candidatesFunction · 0.85

Calls 3

pdf_u_wordFunction · 0.85
ident_startFunction · 0.85
ident_contFunction · 0.85

Tested by

no test coverage detected