From b219d4b468e5393d693a6c37b6748f1a1579f9e6 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 2 Nov 2012 18:39:32 +0100 Subject: [PATCH] Changed the TOKEN_WHITE to contain the actual data - ie the comments --- lexer.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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; } -- 2.39.2