summaryrefslogtreecommitdiff
path: root/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'lex.c')
-rw-r--r--lex.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lex.c b/lex.c
index 6777e42..19a7716 100644
--- a/lex.c
+++ b/lex.c
@@ -232,12 +232,17 @@ lex_line(void) {
struct token *
lex_file(const char *filename_local, FILE *fd_local) {
+ struct token start;
+
filename = filename_local;
fd = fd_local;
line_number = 1;
tok_cursor = tok_start = NULL;
+ start.type = TOK_BEGIN;
+ add_token(start);
+
while (NULL != fgets(buf, sizeof(buf), fd)) {
column_number = 0;
if (lex_line()) {