Replace the old lexer by the new preprocessor.
[cparser] / token.c
diff --git a/token.c b/token.c
index f80d432..9c35b34 100644 (file)
--- a/token.c
+++ b/token.c
@@ -31,7 +31,7 @@
 #include "adt/error.h"
 #include "adt/util.h"
 
-static symbol_t *token_symbols[T_LAST_TOKEN];
+symbol_t *token_symbols[T_LAST_TOKEN];
 
 const source_position_t builtin_source_position = { "<built-in>", 0, 0, true };
 
@@ -86,11 +86,6 @@ void exit_tokens(void)
 
 void print_token_kind(FILE *f, token_kind_t token_kind)
 {
-       if(token_kind == T_EOF) {
-               fputs("end of file", f);
-               return;
-       }
-
        if (token_kind >= lengthof(token_symbols)) {
                fputs("invalid token", f);
                return;
@@ -115,6 +110,7 @@ void print_token(FILE *f, const token_t *token)
        char const *val;
        switch (token->kind) {
        case T_IDENTIFIER:
+       case T_MACRO_PARAMETER:
        case T_UNKNOWN_CHAR:
                val = token->base.symbol->string;
                break;