diff --git a/core/lexer.c b/core/lexer.c index fef9eb8..f6af9c8 100644 --- a/core/lexer.c +++ b/core/lexer.c @@ -208,6 +208,13 @@ lexer_check_direc(struct rifle_state *state, struct token *tok) return; } + break; + case 'p': + if (strcmp(tok->s, ".pub") == 0) { + tok->type = TT_PUB; + return; + } + break; } } diff --git a/core/parser.c b/core/parser.c index 0eaae49..2447987 100644 --- a/core/parser.c +++ b/core/parser.c @@ -72,6 +72,7 @@ static const char *toktab[] = { [TT_F] = qtok(".f"), [TT_STRUCT] = qtok(".struct"), [TT_EXTERN] = qtok(".extern"), + [TT_PUB] = qtok(".pub"), [TT_VOID] = qtok("void"), [TT_U8] = qtok("u8"), [TT_U16] = qtok("u16"), @@ -520,6 +521,8 @@ parse_begin(struct rifle_state *state) return -1; } + break; + case TT_PUB: break; default: utok1(state, &tok); diff --git a/inc/rifle/token.h b/inc/rifle/token.h index cbf787a..1a83331 100644 --- a/inc/rifle/token.h +++ b/inc/rifle/token.h @@ -22,6 +22,7 @@ typedef enum { TT_F, /* '.f' */ TT_STRUCT, /* '.struct' */ TT_EXTERN, /* '.extern' */ + TT_PUB, /* '.pub' */ TT_VOID, /* 'void' */ TT_U8, /* 'u8' */ TT_U16, /* 'u16' */