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

Function unwrap_array_text

internal/cbm/lsp/java_lsp.c:236–252  ·  view source on GitHub ↗

Strip array suffix (`int[]` → `int`, `String[][]` → `String`, dim=2). */

Source from the content-addressed store, hash-verified

234
235/* Strip array suffix (`int[]` → `int`, `String[][]` → `String`, dim=2). */
236static const char *unwrap_array_text(CBMArena *a, const char *type_text, int *out_dim) {
237 if (out_dim)
238 *out_dim = 0;
239 if (!type_text)
240 return NULL;
241 size_t n = strlen(type_text);
242 int dim = 0;
243 while (n >= 2 && type_text[n - 1] == ']' && type_text[n - 2] == '[') {
244 n -= 2;
245 dim++;
246 }
247 if (out_dim)
248 *out_dim = dim;
249 if (dim == 0)
250 return type_text;
251 return cbm_arena_strndup(a, type_text, n);
252}
253
254/* Map primitive name → boxed wrapper QN. */
255static const CBMType *box_primitive(CBMArena *a, const char *prim) {

Callers 1

parse_param_text_fullFunction · 0.85

Calls 1

cbm_arena_strndupFunction · 0.50

Tested by

no test coverage detected