summaryrefslogtreecommitdiff
path: root/tokenizer.c
diff options
context:
space:
mode:
Diffstat (limited to 'tokenizer.c')
-rw-r--r--tokenizer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tokenizer.c b/tokenizer.c
index ae17a4d..6423eed 100644
--- a/tokenizer.c
+++ b/tokenizer.c
@@ -18,7 +18,7 @@ static const char *keywords[KW_COUNT] =
static inline const char *kw_to_str(Keyword k) { return keywords[k]; }
static const char *directives[DIRECT_COUNT] =
- {"C", "sizeof", "alignof"};
+ {"C", "sizeof", "alignof", "export"};
/* Returns KW_COUNT if it's not a keyword */
/* OPTIM: don't use strncmp so much */
@@ -62,6 +62,10 @@ static inline bool token_is_kw(Token *t, Keyword kw) {
return t->kind == TOKEN_KW && t->kw == kw;
}
+static inline bool token_is_direct(Token *t, Directive d) {
+ return t->kind == TOKEN_DIRECT && t->direct == d;
+}
+
static const char *token_kind_to_str(TokenKind t) {
switch (t) {
case TOKEN_KW: return "keyword";