]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Parsing a comma as an operator now - unless noop is true
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Fri, 27 Jul 2012 11:47:01 +0000 (13:47 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Fri, 27 Jul 2012 11:47:01 +0000 (13:47 +0200)
lexer.c

diff --git a/lexer.c b/lexer.c
index 1bea430edd36b1929505d8baf2fba3b7b9457cde..3f1aa76c0f5c312273a1d17a8c33fe06996e8627 100644 (file)
--- 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 == '=' ||              /* == */