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

Function go_scan_error_tree

internal/cbm/doclink_go.c:1825–1841  ·  view source on GitHub ↗

A tree with parse errors: functions, methods and types are found wherever * the extractor's walk finds them (it descends into everything but function * nodes), so that this scan and the graph agree on what is declared. An * explicit stack: the depth is the input's. */

Source from the content-addressed store, hash-verified

1823 * nodes), so that this scan and the graph agree on what is declared. An
1824 * explicit stack: the depth is the input's. */
1825static void go_scan_error_tree(go_scan_t *s, TSNode root) {
1826 int cap = 0;
1827 int top = 0;
1828 TSNode *stack = (TSNode *)go_grow(s->tmp, NULL, 0, &cap, sizeof(TSNode));
1829 if (!stack) {
1830 s->failed = true;
1831 return;
1832 }
1833 stack[top++] = root;
1834 while (top > 0 && !s->failed) {
1835 TSNode n = stack[--top];
1836 if (go_scan_decl(s, n) || go_kind_is(n, "method_elem") || go_kind_is(n, "func_literal")) {
1837 continue;
1838 }
1839 stack = go_push_children(s, n, stack, &top, &cap);
1840 }
1841}
1842
1843static int go_claim_cmp(const void *a, const void *b) {
1844 const go_claim_t *x = (const go_claim_t *)a;

Callers 1

Calls 4

go_growFunction · 0.85
go_scan_declFunction · 0.85
go_kind_isFunction · 0.85
go_push_childrenFunction · 0.85

Tested by

no test coverage detected