]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Changed the preprocess test to reproduce the input file
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 2 Nov 2012 17:37:58 +0000 (18:37 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 2 Nov 2012 17:37:58 +0000 (18:37 +0100)
preprocess.c

index adf5e5e5a5a23f540abb1a6a20f7ade25dad9119..32f9c2828229d694ab599a5b068b307527731d47 100644 (file)
@@ -9,6 +9,7 @@ bool preprocess(const char *filename)
 
     do {
         tok = lex_do(lex);
+        /*
         if (tok == TOKEN_EOL)
             printf("EOL");
         else if (tok >= TOKEN_START && tok <= TOKEN_FATAL)
@@ -19,6 +20,13 @@ bool preprocess(const char *filename)
             printf(">>%s<<\n", lex->tok.value);
         else
             printf("\n");
+        */
+        if (tok == TOKEN_EOL)
+            printf("\n");
+        else if (tok >= TOKEN_START && tok < TOKEN_EOF)
+            printf("%s", lex->tok.value);
+        else
+            printf("%c", tok);
     } while (tok < TOKEN_EOF);
 
     lex_close(lex);