]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
linecounting issue in the lexer
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 16:50:31 +0000 (17:50 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 16:50:31 +0000 (17:50 +0100)
lexer.c

diff --git a/lexer.c b/lexer.c
index 10a00914c1071bf65abbd71d644e2b890e94eb3c..49b8ada16eaadfdb8f123eb1be69f26548c9f776 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -883,14 +883,14 @@ int lex_do(lex_file *lex)
         continue;
     }
 
-    lex->sline = lex->line;
-    lex->tok.ctx.line = lex->sline;
-    lex->tok.ctx.file = lex->name;
-
     if (lex->flags.preprocessing && (ch == TOKEN_WHITE || ch == TOKEN_EOL || ch == TOKEN_FATAL)) {
         return (lex->tok.ttype = ch);
     }
 
+    lex->sline = lex->line;
+    lex->tok.ctx.line = lex->sline;
+    lex->tok.ctx.file = lex->name;
+
     if (lex->eof)
         return (lex->tok.ttype = TOKEN_FATAL);