mojoshader_preprocessor.c
changeset 693 0cdfff18820c
parent 692 08a5fca606ff
child 698 a6cd16b3e270
--- a/mojoshader_preprocessor.c	Mon Feb 23 23:41:32 2009 -0500
+++ b/mojoshader_preprocessor.c	Mon Feb 23 23:42:57 2009 -0500
@@ -1790,6 +1790,12 @@
                 continue;  // pushed the include_stack.
         } // else if
 
+        else if (token == ((Token) '\n'))
+        {
+            // preprocessor is line-oriented, nothing else gets newlines.
+            continue;  // get the next thing.
+        } // else if
+
         assert(!skipping);
         *_token = token;
         *_len = state->tokenlen;
@@ -1947,10 +1953,7 @@
         // It ignores newlines, and then inserts its own around certain
         //  tokens. For example, after a semicolon. This allows HLSL code to
         //  be mostly readable, instead of a stream of tokens.
-        if (token == ((Token) '\n'))
-            isnewline = nl;  // this doesn't actually care about '\n' ...
-
-        else if ( (token == ((Token) '}')) || (token == ((Token) ';')) )
+        if ( (token == ((Token) '}')) || (token == ((Token) ';')) )
         {
             if (!out_of_memory)
             {