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

Function path_at

internal/cbm/doc_pdf.c:458–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458static int path_at(const uint32_t *t, int n, int p) {
459 if (p > 0) {
460 uint32_t b = t[p - 1];
461 if (pdf_u_word(b) || b == '/' || b == '.' || b == '-' || b == '~' || b == '$' || b == '@') {
462 return -1;
463 }
464 }
465 /* (?:\.{1,2}/|~/|/)? tried in order, then without */
466 int e;
467 if (p + 2 < n && t[p] == '.' && t[p + 1] == '.' && t[p + 2] == '/' &&
468 (e = path_body(t, n, p + 3)) >= 0) {
469 return e;
470 }
471 if (p + 1 < n && t[p] == '.' && t[p + 1] == '/' && (e = path_body(t, n, p + 2)) >= 0) {
472 return e;
473 }
474 if (p + 1 < n && t[p] == '~' && t[p + 1] == '/' && (e = path_body(t, n, p + 2)) >= 0) {
475 return e;
476 }
477 if (t[p] == '/' && (e = path_body(t, n, p + 1)) >= 0) {
478 return e;
479 }
480 return path_body(t, n, p);
481}
482
483/* QUAL_RE: [A-Za-z_$][\w$]*(?:(?:\.|::|->|#)[A-Za-z_$][\w$]*)+(?:\(\))? */
484static int qual_at(const uint32_t *t, int n, int p) {

Callers 1

candidatesFunction · 0.85

Calls 2

pdf_u_wordFunction · 0.85
path_bodyFunction · 0.85

Tested by

no test coverage detected