mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 02:31:28 +00:00
reset the column counter on a newline
This commit is contained in:
parent
454234ef5f
commit
ba94df47f0
1 changed files with 6 additions and 2 deletions
8
lexer.c
8
lexer.c
|
@ -352,14 +352,18 @@ static int lex_getch(lex_file *lex)
|
|||
|
||||
if (lex->peekpos) {
|
||||
lex->peekpos--;
|
||||
if (!lex->push_line && lex->peek[lex->peekpos] == '\n')
|
||||
if (!lex->push_line && lex->peek[lex->peekpos] == '\n') {
|
||||
lex->line++;
|
||||
lex->column = 0;
|
||||
}
|
||||
return lex->peek[lex->peekpos];
|
||||
}
|
||||
|
||||
ch = lex_fgetc(lex);
|
||||
if (!lex->push_line && ch == '\n')
|
||||
if (!lex->push_line && ch == '\n') {
|
||||
lex->line++;
|
||||
lex->column = 0;
|
||||
}
|
||||
else if (ch == '?')
|
||||
return lex_try_trigraph(lex, ch);
|
||||
else if (!lex->flags.nodigraphs && (ch == '<' || ch == ':' || ch == '%'))
|
||||
|
|
Loading…
Reference in a new issue