From: Wolfgang (Blub) Bumiller Date: Fri, 2 Nov 2012 17:39:32 +0000 (+0100) Subject: Changed the TOKEN_WHITE to contain the actual data - ie the comments X-Git-Tag: 0.1~51 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b219d4b468e5393d693a6c37b6748f1a1579f9e6;p=xonotic%2Fgmqcc.git Changed the TOKEN_WHITE to contain the actual data - ie the comments --- diff --git a/lexer.c b/lexer.c index 4d184d0..08a63d6 100644 --- a/lexer.c +++ b/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; }