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

Function eval_unary

internal/cbm/lsp/java_lsp.c:1290–1308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1288}
1289
1290static const CBMType *eval_unary(JavaLSPContext *ctx, TSNode node) {
1291 /* `!x` → boolean; `-x` / `~x` / ++ / -- preserve the operand type. */
1292 char *op = NULL;
1293 uint32_t cn = ts_node_child_count(node);
1294 for (uint32_t i = 0; i < cn; i++) {
1295 TSNode c = ts_node_child(node, i);
1296 if (ts_node_is_named(c))
1297 continue;
1298 op = java_node_text(ctx, c);
1299 break;
1300 }
1301 if (op && strcmp(op, "!") == 0)
1302 return cbm_type_builtin(ctx->arena, "boolean");
1303 TSNode operand = ts_node_child_by_field_name(node, "operand", 7);
1304 if (ts_node_is_null(operand) && ts_node_named_child_count(node) > 0) {
1305 operand = ts_node_named_child(node, 0);
1306 }
1307 return java_eval_expr_type(ctx, operand);
1308}
1309
1310static const CBMType *eval_lambda(JavaLSPContext *ctx, TSNode node) {
1311 (void)node;

Callers 1

java_eval_expr_typeFunction · 0.85

Calls 3

java_node_textFunction · 0.85
cbm_type_builtinFunction · 0.85
java_eval_expr_typeFunction · 0.85

Tested by

no test coverage detected