From: Wolfgang (Blub) Bumiller Date: Sun, 18 Nov 2012 14:30:40 +0000 (+0100) Subject: Better linecounting for pragmas; support for prgama file(filename) X-Git-Tag: 0.1.9~404^2~15 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e66f2bcb330de3d11444000d191fd097ad111682;p=xonotic%2Fgmqcc.git Better linecounting for pragmas; support for prgama file(filename) --- 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: