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

Function php_push

internal/cbm/doclink_php.c:148–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148static void php_push(const php_emit_t *em, const char *ref, size_t n, uint32_t line) {
149 while (n > 0 && (ref[n - SKIP_ONE] == '.' || ref[n - SKIP_ONE] == ',' ||
150 ref[n - SKIP_ONE] == ';' || ref[n - SKIP_ONE] == ':')) {
151 n--; /* sentence punctuation */
152 }
153 if (n == 0) {
154 return;
155 }
156 if (n > CBM_DOCLINK_PHP_REF_MAX) {
157 n = CBM_DOCLINK_PHP_REF_MAX + SKIP_ONE; /* clipped: the resolver calls it unparseable */
158 }
159 int syntax = php_is_url(ref, n) ? CBM_DOCLINK_HREF : CBM_DOCLINK_PHP_SEE;
160 char *copy = cbm_arena_strndup(em->ctx->arena, ref, n);
161 if (!copy) {
162 return;
163 }
164 CBMDocLink link = {
165 .source_qn = em->def->qualified_name,
166 .raw = copy,
167 .line = line,
168 .def_line = em->def->start_line,
169 .syntax = (uint16_t)syntax,
170 };
171 cbm_doclinks_push(&em->ctx->result->doc_links, em->ctx->arena, link);
172}
173
174/* One doc line: its text after the leading `*`, and its source line. */
175typedef struct {

Callers 2

php_line_inlineFunction · 0.85
php_line_seeFunction · 0.85

Calls 3

php_is_urlFunction · 0.85
cbm_doclinks_pushFunction · 0.85
cbm_arena_strndupFunction · 0.70

Tested by

no test coverage detected