]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
parsing the ternary
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index e4328bec26f37b6b391019cfc99aebdf282fcf1b..5a1f23e43cb7ed56b3127dfb1aead63364080ff7 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -23,7 +23,7 @@ static size_t num_keywords_qc = sizeof(keywords_qc) / sizeof(keywords_qc[0]);
 /* For fte/gmgqcc */
 static const char *keywords_fg[] = {
     "var",
-    "switch",
+    "switch", "case", "default",
     "struct", "union",
     "break", "continue"
 };
@@ -1021,6 +1021,7 @@ int lex_do(lex_file *lex)
     {
         case '[':
         case '(':
+        case ':':
             lex_tokench(lex, ch);
             lex_endtoken(lex);
             if (lex->flags.noops)
@@ -1029,7 +1030,6 @@ int lex_do(lex_file *lex)
                 return (lex->tok.ttype = TOKEN_OPERATOR);
         case ')':
         case ';':
-        case ':':
         case '{':
         case '}':
         case ']':