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

Function lisp_head_text

internal/cbm/extract_imports.c:2423–2436  ·  view source on GitHub ↗

The s-expression head symbol text, or NULL if the list has no symbol head. */

Source from the content-addressed store, hash-verified

2421
2422/* The s-expression head symbol text, or NULL if the list has no symbol head. */
2423static char *lisp_head_text(CBMExtractCtx *ctx, TSNode list, TSNode *out_head) {
2424 if (ts_node_named_child_count(list) < 1) {
2425 return NULL;
2426 }
2427 TSNode head = ts_node_named_child(list, 0);
2428 const char *ht = ts_node_type(head);
2429 if (strcmp(ht, "symbol") != 0 && strcmp(ht, "sym_lit") != 0) {
2430 return NULL;
2431 }
2432 if (out_head) {
2433 *out_head = head;
2434 }
2435 return cbm_node_text(ctx->arena, head, ctx->source);
2436}
2437
2438/* Process one s-expression list as a potential import/namespace form. */
2439static void lisp_process_list(CBMExtractCtx *ctx, TSNode node) {

Callers 1

lisp_process_listFunction · 0.85

Calls 1

cbm_node_textFunction · 0.85

Tested by

no test coverage detected