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

Function process_wolfram_needs

internal/cbm/extract_imports.c:1670–1690  ·  view source on GitHub ↗

Handle Wolfram Needs["package`"] — apply where head is builtin_symbol "Needs".

Source from the content-addressed store, hash-verified

1668
1669// Handle Wolfram Needs["package`"] — apply where head is builtin_symbol "Needs".
1670static void process_wolfram_needs(CBMExtractCtx *ctx, TSNode node) {
1671 CBMArena *a = ctx->arena;
1672 if (ts_node_named_child_count(node) < MIN_WOLFRAM_CHILDREN) {
1673 return;
1674 }
1675 TSNode head = ts_node_named_child(node, 0);
1676 if (strcmp(ts_node_type(head), "builtin_symbol") != 0) {
1677 return;
1678 }
1679 char *name = cbm_node_text(a, head, ctx->source);
1680 if (!name || strcmp(name, "Needs") != 0) {
1681 return;
1682 }
1683 TSNode arg = ts_node_named_child(node, SECOND_IDX);
1684 char *text = cbm_node_text(a, arg, ctx->source);
1685 if (text && text[0]) {
1686 char *path = strip_quotes(a, text);
1687 CBMImport imp = {.local_name = path_last(a, path), .module_path = path};
1688 cbm_imports_push(&ctx->result->imports, a, imp);
1689 }
1690}
1691
1692static void walk_wolfram_imports(CBMExtractCtx *ctx, TSNode root) {
1693 TSNodeStack stack;

Callers 1

walk_wolfram_importsFunction · 0.85

Calls 4

cbm_node_textFunction · 0.85
path_lastFunction · 0.85
cbm_imports_pushFunction · 0.85
strip_quotesFunction · 0.70

Tested by

no test coverage detected