]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Don't produce 'unknown token' errors in preprocessing mode
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 14:38:03 +0000 (15:38 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 14:38:03 +0000 (15:38 +0100)
lexer.c

diff --git a/lexer.c b/lexer.c
index 295cb5b1955b1d506f41396bc4c5acd60ffef2a5..258fb97a9605eac6efc9ad11103f47b4dc75cb67 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -1381,6 +1381,12 @@ int lex_do(lex_file *lex)
         return lex->tok.ttype;
     }
 
+    if (lex->flags.preprocessing) {
+        lex_tokench(lex, ch);
+        lex_endtoken(lex);
+        return (lex->tok.ttype = ch);
+    }
+
     lexerror(lex, "unknown token");
     return (lex->tok.ttype = TOKEN_ERROR);
 }