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

Function extract_php_vars

internal/cbm/extract_defs.c:9598–9616  ·  view source on GitHub ↗

PHP variable extraction from expression_statement.

Source from the content-addressed store, hash-verified

9596
9597// PHP variable extraction from expression_statement.
9598static void extract_php_vars(CBMExtractCtx *ctx, TSNode node, CBMArena *a, const char *kind) {
9599 if (strcmp(kind, "expression_statement") != 0) {
9600 return;
9601 }
9602 uint32_t nc = ts_node_named_child_count(node);
9603 for (uint32_t j = 0; j < nc; j++) {
9604 TSNode inner = ts_node_named_child(node, j);
9605 if (strcmp(ts_node_type(inner), "assignment_expression") == 0) {
9606 TSNode left = ts_node_child_by_field_name(inner, TS_FIELD("left"));
9607 if (!ts_node_is_null(left)) {
9608 char *name = cbm_node_text(a, left, ctx->source);
9609 if (name && name[0] == '$') {
9610 name++;
9611 }
9612 push_var_def(ctx, name, node);
9613 }
9614 }
9615 }
9616}
9617
9618static void extract_vars_dynamic(CBMExtractCtx *ctx, TSNode node, CBMArena *a, const char *kind) {
9619 switch (ctx->language) {

Callers 1

extract_vars_dynamicFunction · 0.85

Calls 2

cbm_node_textFunction · 0.85
push_var_defFunction · 0.85

Tested by

no test coverage detected