| 1288 | } |
| 1289 | |
| 1290 | static 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 | |
| 1310 | static const CBMType *eval_lambda(JavaLSPContext *ctx, TSNode node) { |
| 1311 | (void)node; |
no test coverage detected