aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tokenize.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokenize.c')
-rw-r--r--src/tokenize.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tokenize.c b/src/tokenize.c
index 26c6e13..ceba12d 100644
--- a/src/tokenize.c
+++ b/src/tokenize.c
@@ -37,7 +37,7 @@ static void pplexer_tokenize_pp_directive(Lexer* l, Token* tok) {
StrBuilder builder;
strbuilder_init(&builder);
- while (isalnum(infile_peek_char(l->src))) {
+ while (isalnum(infile_peek_char(l->src)) || infile_peek_char(l->src) == '_') {
strbuilder_append_char(&builder, infile_peek_char(l->src));
infile_next_char(l->src);
}
@@ -70,6 +70,9 @@ static void pplexer_tokenize_pp_directive(Lexer* l, Token* tok) {
} else if (strcmp(pp_directive_name, "include") == 0) {
l->expect_header_name = true;
tok->kind = TokenKind_pp_directive_include;
+ } else if (strcmp(pp_directive_name, "include_next") == 0) {
+ l->expect_header_name = true;
+ tok->kind = TokenKind_pp_directive_include_next;
} else if (strcmp(pp_directive_name, "line") == 0) {
tok->kind = TokenKind_pp_directive_line;
} else if (strcmp(pp_directive_name, "pragma") == 0) {