--- a/mojoshader_lexer.c Mon Jun 23 14:56:00 2014 -0400
+++ b/mojoshader_lexer.c Thu Oct 02 15:54:31 2014 -0400
@@ -1164,6 +1164,18 @@
RET(TOKEN_MULTI_COMMENT);
else if (s->report_whitespace)
RET(' ');
+
+ // Microsoft's preprocessor allows multiline comments
+ // before a preprocessor directive, even though C/C++
+ // doesn't. See if we've hit this case.
+ #if MATCH_MICROSOFT_PREPROCESSOR
+ if (s->tokenval == ((Token) '\n')) // was start of line?
+ {
+ update_state(s, eoi, cursor, token, (Token) '\n');
+ goto ppdirective; // may jump back to scanner_loop.
+ }
+ #endif
+
goto scanner_loop;
}
}