diff options
-rw-r--r-- | eval.c | 3 | ||||
-rw-r--r-- | lexer.c | 2 | ||||
-rw-r--r-- | lexer.h | 5 |
3 files changed, 5 insertions, 5 deletions
@@ -25,9 +25,6 @@ #include <stdlib.h> #include <stdarg.h> -#define T_MAX (sizeof(tokennames) / sizeof(tokennames[0])) -#define T_EXCEPTION (T_MAX + 0) - static struct ut_opcode exception_tag = { .type = T_EXCEPTION }; @@ -136,7 +136,7 @@ static const struct token reserved_words[] = { { T_IN, "in", 2 }, }; -const char *tokennames[69] = { +const char *tokennames[__T_MAX] = { [0] = "End of file", [T_FUNC] = "'function'", [T_LOCAL] = "'local'", @@ -19,7 +19,10 @@ #include "ast.h" -extern const char *tokennames[69]; +#define __T_MAX 69 +#define T_EXCEPTION (__T_MAX + 0) + +extern const char *tokennames[__T_MAX]; bool utf8enc(char **out, int *rem, int code); |