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

Function strip_generic_args

internal/cbm/extract_calls.c:199–212  ·  view source on GitHub ↗

Strip a trailing generic argument list ("<...>" / "[...]") from a type name, returning the bare type identifier. Mutates an arena-owned copy in place.

Source from the content-addressed store, hash-verified

197// Strip a trailing generic argument list ("<...>" / "[...]") from a type name,
198// returning the bare type identifier. Mutates an arena-owned copy in place.
199static char *strip_generic_args(char *t) {
200 if (!t) {
201 return NULL;
202 }
203 char *angle = strchr(t, '<');
204 if (angle) {
205 *angle = '\0';
206 }
207 char *brack = strchr(t, '[');
208 if (brack) {
209 *brack = '\0';
210 }
211 return t;
212}
213
214// Pull the constructed type name out of a constructor/instantiation node:
215// new_expression (TS/JS) -> `constructor`/`type` field or first type child

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected