From 378e88dce05799952a294f99df661fc4ef180bee Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 15 Feb 2009 02:51:39 -0500 Subject: [PATCH] Lexer now handles '\\' continuation at the end of a line. --- mojoshader_lexer.re | 5 +++-- mojoshader_preprocessor.c | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mojoshader_lexer.re b/mojoshader_lexer.re index 12368d64..12ea15ef 100644 --- a/mojoshader_lexer.re +++ b/mojoshader_lexer.re @@ -69,6 +69,8 @@ scanner_loop: */ /*!re2c + "\\" [ \t\v\f]* NEWLINE { s->line++; goto scanner_loop; } + "/*" { goto multilinecomment; } "//" { goto singlelinecomment; } @@ -83,7 +85,7 @@ scanner_loop: (["] (ESC|ANY\[\r\n\\"])* ["]) { RET(TOKEN_STRING_LITERAL); } - + ">>=" { RET(TOKEN_RSHIFTASSIGN); } "<<=" { RET(TOKEN_LSHIFTASSIGN); } "+=" { RET(TOKEN_ADDASSIGN); } @@ -129,7 +131,6 @@ scanner_loop: "}" { RET('}'); } "=" { RET('='); } "?" { RET('?'); } - "\\" { RET('\\'); } PP "include" { RET(TOKEN_PP_INCLUDE); } PP "line" { RET(TOKEN_PP_LINE); } diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index 70dc5176..25015b07 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -568,10 +568,6 @@ int preprocessor_outofmemory(Preprocessor *_ctx) } // preprocessor_outofmemory -// !!! FIXME: (almost?) all preprocessor directives can end a line with a -// !!! FIXME: '\\' to continue to the next line. - - static int require_newline(IncludeState *state) { const char *source = state->source;