From: Wolfgang (Blub) Bumiller Date: Sun, 11 Nov 2012 17:57:02 +0000 (+0100) Subject: Fixing lexer to not classify wrong tokens as operators X-Git-Tag: 0.1~19^2~25 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=22d6ff230970642a5fcce1d0985ac502fbe44b18;p=xonotic%2Fgmqcc.git Fixing lexer to not classify wrong tokens as operators --- diff --git a/lexer.c b/lexer.c index 19d6720..a550ed0 100644 --- a/lexer.c +++ b/lexer.c @@ -852,6 +852,7 @@ int lex_do(lex_file *lex) /* single-character tokens */ switch (ch) { + case '[': case '(': if (!lex_tokench(lex, ch) || !lex_endtoken(lex)) @@ -866,14 +867,6 @@ int lex_do(lex_file *lex) case ';': case '{': case '}': - case '[': - if (!lex_tokench(lex, ch) || - !lex_endtoken(lex)) - { - return (lex->tok.ttype = TOKEN_FATAL); - } - if (!lex->flags.noops) - return (lex->tok.ttype = TOKEN_OPERATOR); case ']': case '#':