aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/parse.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-09 19:04:39 +0200
committerlemon <lsof@mailbox.org>2022-08-09 19:04:39 +0200
commit61cc8035ab70ff1bfe0091eed1ff1a3d4c6c9c7b (patch)
tree09e87d6938f55143b553aa35164b4697f1f3d780 /bootstrap/parse.c
parent5bd28cd1c352e8fe20dcde310de6ab570fdcbb17 (diff)
!=
Diffstat (limited to 'bootstrap/parse.c')
-rw-r--r--bootstrap/parse.c4
1 files changed, 2 insertions, 2 deletions
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);