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

Function cbm_lisp_node_in_quote

internal/cbm/helpers.c:214–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214bool cbm_lisp_node_in_quote(CBMArena *a, TSNode node, const char *source) {
215 TSNode cur = ts_node_parent(node);
216 for (int guard = 0; guard < CBM_LISP_QUOTE_ANCESTOR_MAX && !ts_node_is_null(cur); guard++) {
217 const char *ck = ts_node_type(cur);
218 if ((strcmp(ck, "list") == 0 || strcmp(ck, "list_lit") == 0) &&
219 ts_node_named_child_count(cur) > 0) {
220 TSNode h = ts_node_named_child(cur, 0);
221 const char *hk = ts_node_type(h);
222 if (strcmp(hk, "symbol") == 0 || strcmp(hk, "sym_lit") == 0) {
223 char *ht = cbm_node_text(a, h, source);
224 if (ht &&
225 (strcmp(ht, "q") == 0 || strcmp(ht, "quote") == 0 || strcmp(ht, "qq") == 0)) {
226 return true;
227 }
228 }
229 }
230 cur = ts_node_parent(cur);
231 }
232 return false;
233}
234
235TSNode cbm_lisp_named_child_skip_comments(TSNode node, uint32_t want) {
236 uint32_t nc = ts_node_named_child_count(node);

Callers 3

extract_lisp_calleeFunction · 0.85
extract_lisp_defFunction · 0.85
compute_lisp_func_qnFunction · 0.85

Calls 1

cbm_node_textFunction · 0.85

Tested by

no test coverage detected