From c73e96ff916209d74e2be9bd7d8de3758685ce4d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 2 Apr 2024 13:08:06 -0400 Subject: Add comparison operator <> and array method to sort by a custom comparison function --- typecheck.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'typecheck.c') diff --git a/typecheck.c b/typecheck.c index 6f92374f..f876851e 100644 --- a/typecheck.c +++ b/typecheck.c @@ -652,6 +652,8 @@ type_t *get_type(env_t *env, ast_t *ast) code_err(ast, "I can't compare these two different types: %T vs %T", lhs_t, rhs_t); return Type(BoolType); } + case BINOP_CMP: + return Type(IntType, .bits=32); case BINOP_POWER: { type_t *result = get_math_type(env, ast, lhs_t, rhs_t); if (result->tag == NumType) -- cgit v1.2.3