From: Wolfgang Bumiller Date: Fri, 27 Jul 2012 11:47:01 +0000 (+0200) Subject: Parsing a comma as an operator now - unless noop is true X-Git-Tag: 0.1-rc1~382 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=64c230d2222e53e754c8d8636fc6cb2c6eda7e0c Parsing a comma as an operator now - unless noop is true --- diff --git a/lexer.c b/lexer.c index 1bea430..3f1aa76 100644 --- a/lexer.c +++ b/lexer.c @@ -464,8 +464,6 @@ int lex_do(lex_file *lex) case '[': case ']': - case ',': - case '#': return (lex->tok->ttype = ch); @@ -491,12 +489,22 @@ int lex_do(lex_file *lex) case '|': case '^': case '~': + case ',': return ch; default: break; } } + if (ch == ',') { + if (!lex_tokench(lex, ch) || + !lex_endtoken(lex)) + { + return (lex->tok->ttype = TOKEN_FATAL); + } + return (lex->tok->ttype = TOKEN_OPERATOR); + } + if (ch == '+' || ch == '-' || /* ++, --, +=, -= and -> as well! */ ch == '>' || ch == '<' || /* <<, >>, <=, >= */ ch == '=' || /* == */