mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-31 15:01:01 +00:00
Changed the TOKEN_WHITE to contain the actual data - ie the comments
This commit is contained in:
parent
caf4771ba1
commit
b219d4b468
1 changed files with 8 additions and 10 deletions
18
lexer.c
18
lexer.c
|
@ -385,17 +385,17 @@ static int lex_skipwhite(lex_file *lex)
|
|||
ch = lex_getch(lex);
|
||||
|
||||
if (lex->flags.preprocessing) {
|
||||
if (!lex_tokench(lex, ' ') ||
|
||||
!lex_tokench(lex, ' '))
|
||||
if (!lex_tokench(lex, '/') ||
|
||||
!lex_tokench(lex, '/'))
|
||||
{
|
||||
return TOKEN_FATAL;
|
||||
}
|
||||
}
|
||||
|
||||
while (ch != EOF && ch != '\n') {
|
||||
ch = lex_getch(lex);
|
||||
if (lex->flags.preprocessing && !lex_tokench(lex, ' '))
|
||||
if (lex->flags.preprocessing && !lex_tokench(lex, ch))
|
||||
return TOKEN_FATAL;
|
||||
ch = lex_getch(lex);
|
||||
}
|
||||
if (lex->flags.preprocessing) {
|
||||
lex_ungetch(lex, '\n');
|
||||
|
@ -410,8 +410,8 @@ static int lex_skipwhite(lex_file *lex)
|
|||
/* multiline comment */
|
||||
haswhite = true;
|
||||
if (lex->flags.preprocessing) {
|
||||
if (!lex_tokench(lex, ' ') ||
|
||||
!lex_tokench(lex, ' '))
|
||||
if (!lex_tokench(lex, '/') ||
|
||||
!lex_tokench(lex, '*'))
|
||||
{
|
||||
return TOKEN_FATAL;
|
||||
}
|
||||
|
@ -424,8 +424,8 @@ static int lex_skipwhite(lex_file *lex)
|
|||
ch = lex_getch(lex);
|
||||
if (ch == '/') {
|
||||
if (lex->flags.preprocessing) {
|
||||
if (!lex_tokench(lex, ' ') ||
|
||||
!lex_tokench(lex, ' '))
|
||||
if (!lex_tokench(lex, '*') ||
|
||||
!lex_tokench(lex, '/'))
|
||||
{
|
||||
return TOKEN_FATAL;
|
||||
}
|
||||
|
@ -434,8 +434,6 @@ static int lex_skipwhite(lex_file *lex)
|
|||
}
|
||||
}
|
||||
if (lex->flags.preprocessing) {
|
||||
if (ch != '\n')
|
||||
ch = ' ';
|
||||
if (!lex_tokench(lex, ch))
|
||||
return TOKEN_FATAL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue