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

Function push_base_text

internal/cbm/extract_defs.c:2080–2102  ·  view source on GitHub ↗

Append a base name (generic args stripped) to out[] if non-empty.

Source from the content-addressed store, hash-verified

2078
2079// Append a base name (generic args stripped) to out[] if non-empty.
2080static void push_base_text(CBMArena *a, TSNode n, const char *source, const char **out, int out_cap,
2081 int *count) {
2082 if (*count >= out_cap) {
2083 return;
2084 }
2085 char *t = cbm_node_text(a, n, source);
2086 if (!t) {
2087 return;
2088 }
2089 char *angle = strchr(t, '<');
2090 if (angle) {
2091 *angle = '\0';
2092 }
2093 /* PHP qualified base may be backslash-prefixed (e.g. `\RuntimeException`);
2094 * keep the bare class name so it matches the unqualified declaration. */
2095 char *last_bs = strrchr(t, '\\');
2096 if (last_bs) {
2097 t = last_bs + 1;
2098 }
2099 if (t[0]) {
2100 out[(*count)++] = t;
2101 }
2102}
2103
2104/* TypeScript/TSX: bases live in a `class_heritage` (class) or directly in an
2105 * `extends_type_clause` (interface). The extractor previously captured the

Callers 4

collect_ts_basesFunction · 0.85
extract_php_basesFunction · 0.85
extract_kotlin_basesFunction · 0.85

Calls 1

cbm_node_textFunction · 0.85

Tested by

no test coverage detected