diff options
Diffstat (limited to 'include/tokenizer.h')
-rw-r--r-- | include/tokenizer.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/tokenizer.h b/include/tokenizer.h index d10b789..4018e3a 100644 --- a/include/tokenizer.h +++ b/include/tokenizer.h @@ -6,6 +6,7 @@ #include "std/defs.h" #include "binop_type.h" #include "compiler_options.h" +#include <stdarg.h> #define TOKENIZER_OK 0 /* General error */ @@ -32,7 +33,11 @@ typedef enum { TOK_SEMICOLON, TOK_COLON, TOK_BINOP, - TOK_PUB + TOK_PUB, + TOK_IF, + TOK_ELSE, + TOK_WHILE, + TOK_EXTERN } Token; typedef struct { @@ -71,6 +76,7 @@ CHECK_RESULT int tokenizer_accept(Tokenizer *self, Token expected_token); otherwise @result is set to 1 */ CHECK_RESULT int tokenizer_consume_if(Tokenizer *self, Token expected_token, bool *result); +void tokenizer_print_error_args(Tokenizer *self, int index, const char *fmt, va_list args); void tokenizer_print_error(Tokenizer *self, int index, const char *fmt, ...); void tokenizer_print_error_object(Tokenizer *self, TokenizerError *error); TokenizerError tokenizer_create_error(Tokenizer *self, int index, const char *fmt, ...); |