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

Function eval_array_access

internal/cbm/lsp/java_lsp.c:1218–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1216}
1217
1218static const CBMType *eval_array_access(JavaLSPContext *ctx, TSNode node) {
1219 TSNode arr = ts_node_child_by_field_name(node, "array", 5);
1220 if (ts_node_is_null(arr))
1221 return cbm_type_unknown();
1222 const CBMType *t = java_eval_expr_type(ctx, arr);
1223 if (t && t->kind == CBM_TYPE_SLICE)
1224 return t->data.slice.elem;
1225 /* List<T>[i] in Java is illegal — but at runtime we sometimes see
1226 * Collection.get-style indexing through the array_access node. Stay
1227 * conservative. */
1228 return cbm_type_unknown();
1229}
1230
1231static const CBMType *eval_cast(JavaLSPContext *ctx, TSNode node) {
1232 TSNode type_node = ts_node_child_by_field_name(node, "type", 4);

Callers 1

java_eval_expr_typeFunction · 0.85

Calls 2

cbm_type_unknownFunction · 0.85
java_eval_expr_typeFunction · 0.85

Tested by

no test coverage detected