From 7bc564f175b4e040c90a0774b877a59dfbb8523f Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Thu, 16 Aug 2012 16:06:12 +0200 Subject: [PATCH] lexer: recognize != as operator when noops=false --- lexer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lexer.c b/lexer.c index 0c58a5d..382512d 100644 --- a/lexer.c +++ b/lexer.c @@ -528,6 +528,7 @@ int lex_do(lex_file *lex) case '~': case ',': case '.': + case '!': if (!lex_tokench(lex, ch) || !lex_endtoken(lex)) { @@ -550,7 +551,7 @@ int lex_do(lex_file *lex) if (ch == '+' || ch == '-' || /* ++, --, +=, -= and -> as well! */ ch == '>' || ch == '<' || /* <<, >>, <=, >= */ - ch == '=' || /* == */ + ch == '=' || ch == '!' || /* ==, != */ ch == '&' || ch == '|') /* &&, ||, &=, |= */ { if (!lex_tokench(lex, ch)) @@ -571,6 +572,7 @@ int lex_do(lex_file *lex) return (lex->tok->ttype = TOKEN_OPERATOR); } + /* if (ch == '^' || ch == '~' || ch == '!') { if (!lex_tokench(lex, ch) || @@ -580,6 +582,7 @@ int lex_do(lex_file *lex) } return (lex->tok->ttype = TOKEN_OPERATOR); } + */ if (ch == '*' || ch == '/') /* *=, /= */ { -- 2.39.2