]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Changed the TOKEN_WHITE to contain the actual data - ie the comments
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 2 Nov 2012 17:39:32 +0000 (18:39 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 2 Nov 2012 17:39:32 +0000 (18:39 +0100)
lexer.c

diff --git a/lexer.c b/lexer.c
index 4d184d083d67afdfa1527173d237ba3059590e7b..08a63d624bb7cfc258c9e654aadae2cefb95ed05 100644 (file)
--- 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;
                     }