summaryrefslogtreecommitdiff
path: root/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'lex.c')
-rw-r--r--lex.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lex.c b/lex.c
index 6fe78b3..949425e 100644
--- a/lex.c
+++ b/lex.c
@@ -406,6 +406,13 @@ struct token* lex(const char *filename_local, FILE *fin, size_t *len)
return NULL;
}
+ /* no tokens? just an EOL then */
+ if (tokens_count == 0) {
+ struct token eol = {0};
+ lex_eol(&eol);
+ add_token(eol);
+ }
+
*len = tokens_count;
return tokens;
}