mojoshader_lexer.c
changeset 1123 3d842e7dd6ad
parent 1121 4142681f9fda
child 1142 7b554e065321
--- a/mojoshader_lexer.c	Fri Feb 15 15:01:50 2013 -0500
+++ b/mojoshader_lexer.c	Fri Feb 15 15:10:33 2013 -0500
@@ -65,7 +65,6 @@
     const uchar *matchptr;
     const uchar *limit = cursor + s->bytes_left;
     int eoi = 0;
-    int saw_newline = 0;
 
 
 
@@ -1139,8 +1138,6 @@
 yy186:
 	{
                         s->line++;
-                        token = matchptr;
-                        saw_newline = 1;
                         goto multilinecomment;
                     }
 yy187:
@@ -1165,8 +1162,6 @@
 	{
                         if (s->report_comments)
                             RET(TOKEN_MULTI_COMMENT);
-                        else if (saw_newline)
-                            RET('\n');
                         else if (s->report_whitespace)
                             RET(' ');
                         goto scanner_loop;
@@ -1194,7 +1189,10 @@
 	{
                         s->line++;
                         if (s->report_comments)
+                        {
+                            cursor = matchptr;  // so we RET('\n') next.
                             RET(TOKEN_SINGLE_COMMENT);
+                        }
                         token = matchptr;
                         RET('\n');
                     }