aboutsummaryrefslogtreecommitdiff
path: root/include/tokenizer.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-06-07 10:47:47 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit53a331bc8b2fc33bd2b7e25a23b4128f89ee0b52 (patch)
tree2e5c0f4cda85b2afdb6142145fa7ded61d100f02 /include/tokenizer.h
parent1b68fdcf5aebf2bc53bbd9234c77aea243c0decd (diff)
Add assignment, while, extern, function signature type, start on bytecode
Diffstat (limited to 'include/tokenizer.h')
-rw-r--r--include/tokenizer.h8
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, ...);