mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-26 21:21:34 +00:00
Delete the test preprocess.c file and get the use/build part out of main.c/Makefile
This commit is contained in:
parent
5bef2f2870
commit
bf256abd66
3 changed files with 0 additions and 44 deletions
1
Makefile
1
Makefile
|
@ -25,7 +25,6 @@ OBJ = \
|
||||||
code.o \
|
code.o \
|
||||||
ast.o \
|
ast.o \
|
||||||
ir.o \
|
ir.o \
|
||||||
preprocess.o \
|
|
||||||
error.o
|
error.o
|
||||||
OBJ_A = test/ast-test.o
|
OBJ_A = test/ast-test.o
|
||||||
OBJ_I = test/ir-test.o
|
OBJ_I = test/ir-test.o
|
||||||
|
|
8
main.c
8
main.c
|
@ -460,14 +460,6 @@ int main(int argc, char **argv) {
|
||||||
(items_data[itr].type == TYPE_SRC ? "progs.src" :
|
(items_data[itr].type == TYPE_SRC ? "progs.src" :
|
||||||
("unknown"))))));
|
("unknown"))))));
|
||||||
|
|
||||||
if (opts_pp_only) {
|
|
||||||
if (!preprocess(items_data[itr].filename)) {
|
|
||||||
retval = 1;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!parser_compile(items_data[itr].filename)) {
|
if (!parser_compile(items_data[itr].filename)) {
|
||||||
retval = 1;
|
retval = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
35
preprocess.c
35
preprocess.c
|
@ -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;
|
|
||||||
}
|
|
Loading…
Reference in a new issue