From 61cc8035ab70ff1bfe0091eed1ff1a3d4c6c9c7b Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 9 Aug 2022 19:04:39 +0200 Subject: != --- bootstrap/parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bootstrap/parse.c') diff --git a/bootstrap/parse.c b/bootstrap/parse.c index b1c0371..ef91824 100644 --- a/bootstrap/parse.c +++ b/bootstrap/parse.c @@ -1601,7 +1601,7 @@ matchcmpop(struct parser *P, struct tok *tokp) { *tokp = tok; switch (tok.t) { case '==': case '<=': case '>=': - case '<': case '>': + case '<': case '>': case '!=': lex(P); return 1; } @@ -1620,7 +1620,7 @@ pexcmp(struct parser *P) { if (!typeof2(ex.ty, rhs.ty)) fatal(P, tok.span, "incompatible operands %t and %t to binary operator %T", ex.ty, rhs.ty, tok); - if (tok.t != '==' && !isnumtype(typeof2(ex.ty, rhs.ty))) + if (tok.t != '==' && tok.t != '!=' && !isnumtype(typeof2(ex.ty, rhs.ty))) fatal(P, tok.span, "invalid operands %t and %t to relational operator %T: not numeric", ex.ty, rhs.ty, tok); -- cgit v1.2.3