From e66f2bcb330de3d11444000d191fd097ad111682 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sun, 18 Nov 2012 15:30:40 +0100 Subject: [PATCH] Better linecounting for pragmas; support for prgama file(filename) --- lexer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lexer.c b/lexer.c index 40756c0..ecda7f7 100644 --- a/lexer.c +++ b/lexer.c @@ -405,16 +405,21 @@ static bool lex_try_pragma(lex_file *lex) if (!strcmp(param, "line")) { if (lex->push_line) lex->push_line--; + --line; } else goto unroll; } + else if (!strcmp(command, "file")) { + lex->name = util_strdup(param); + vec_push(lex_filenames, lex->name); + } else goto unroll; + lex->line = line; while (ch != '\n') ch = lex_getch(lex); - lex->line = line; return true; unroll: -- 2.39.2