]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Delete the test preprocess.c file and get the use/build part out of main.c/Makefile
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 2 Nov 2012 17:59:21 +0000 (18:59 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 2 Nov 2012 17:59:21 +0000 (18:59 +0100)
Makefile
main.c
preprocess.c [deleted file]

index 660ec843d17b7e6a458e9aec00bfa855ee67af94..a51aed38ac21cc404c5abba7965af8e8b25cf7ac 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,6 @@ OBJ     = \
           code.o      \
           ast.o       \
           ir.o        \
-          preprocess.o \
           error.o
 OBJ_A = test/ast-test.o
 OBJ_I = test/ir-test.o
diff --git a/main.c b/main.c
index 3fb25ca0441f61eaa77b196db21acc4ee1928948..a65a735ebb6b351442bf6c8be743bc31bc654a76 100644 (file)
--- a/main.c
+++ b/main.c
@@ -460,14 +460,6 @@ int main(int argc, char **argv) {
                      (items_data[itr].type == TYPE_SRC ? "progs.src" :
                      ("unknown"))))));
 
-            if (opts_pp_only) {
-                if (!preprocess(items_data[itr].filename)) {
-                    retval = 1;
-                    goto cleanup;
-                }
-                continue;
-            }
-
             if (!parser_compile(items_data[itr].filename)) {
                 retval = 1;
                 goto cleanup;
diff --git a/preprocess.c b/preprocess.c
deleted file mode 100644 (file)
index 55878a0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "gmqcc.h"
-#include "lexer.h"
-
-bool preprocess(const char *filename)
-{
-    int tok;
-    lex_file *lex = lex_open(filename);
-    lex->flags.preprocessing = true;
-
-    do {
-        tok = lex_do(lex);
-#if 0
-        if (tok == TOKEN_EOL)
-            printf("EOL");
-        else if (tok >= TOKEN_START && tok <= TOKEN_FATAL)
-            printf("%s: ", _tokennames[tok - TOKEN_START]);
-        else
-            printf("TOKEN: '%c'", tok);
-        if (tok == TOKEN_WHITE)
-            printf(">>%s<<\n", lex->tok.value);
-        else
-            printf("\n");
-#else
-        if (tok == TOKEN_EOL)
-            printf("\n");
-        else if (tok >= TOKEN_START && tok < TOKEN_EOF)
-            printf("%s", lex->tok.value);
-        else if (tok < TOKEN_START)
-            printf("%c", tok); /* these are characters */
-#endif
-    } while (tok < TOKEN_EOF);
-
-    lex_close(lex);
-    return true;
-}