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

Function extract_vars_dynamic

internal/cbm/extract_defs.c:4879–4906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4877}
4878
4879static void extract_vars_dynamic(CBMExtractCtx *ctx, TSNode node, CBMArena *a, const char *kind) {
4880 switch (ctx->language) {
4881 case CBM_LANG_PHP:
4882 extract_php_vars(ctx, node, a, kind);
4883 break;
4884 case CBM_LANG_LUA:
4885 extract_lua_vars(ctx, node, a);
4886 break;
4887 case CBM_LANG_RUBY: {
4888 TSNode left = ts_node_child_by_field_name(node, TS_FIELD("left"));
4889 if (!ts_node_is_null(left)) {
4890 const char *lk = ts_node_type(left);
4891 if (strcmp(lk, "identifier") == 0 || strcmp(lk, "constant") == 0) {
4892 push_var_def(ctx, cbm_node_text(a, left, ctx->source), node);
4893 }
4894 }
4895 break;
4896 }
4897 case CBM_LANG_R:
4898 extract_r_vars(ctx, node, a);
4899 break;
4900 case CBM_LANG_PERL:
4901 extract_perl_vars(ctx, node, a);
4902 break;
4903 default:
4904 break;
4905 }
4906}
4907
4908// Kotlin variable name resolution: name > simple_identifier > identifier > variable_declaration.
4909static TSNode resolve_kotlin_var_name(TSNode node) {

Callers 1

extract_var_namesFunction · 0.85

Calls 6

extract_php_varsFunction · 0.85
extract_lua_varsFunction · 0.85
push_var_defFunction · 0.85
cbm_node_textFunction · 0.85
extract_r_varsFunction · 0.85
extract_perl_varsFunction · 0.85

Tested by

no test coverage detected