mojoshader_lexer.c
changeset 1121 4142681f9fda
parent 960 d90fa2381bab
child 1123 3d842e7dd6ad
--- a/mojoshader_lexer.c	Thu Feb 14 00:15:14 2013 -0500
+++ b/mojoshader_lexer.c	Thu Feb 14 00:46:12 2013 -0500
@@ -1163,7 +1163,9 @@
 yy192:
 	++YYCURSOR;
 	{
-                        if (saw_newline)
+                        if (s->report_comments)
+                            RET(TOKEN_MULTI_COMMENT);
+                        else if (saw_newline)
                             RET('\n');
                         else if (s->report_whitespace)
                             RET(' ');
@@ -1189,14 +1191,29 @@
 	}
 	++YYCURSOR;
 yy197:
-	{ s->line++; token = matchptr; RET('\n'); }
+	{
+                        s->line++;
+                        if (s->report_comments)
+                            RET(TOKEN_SINGLE_COMMENT);
+                        token = matchptr;
+                        RET('\n');
+                    }
 yy198:
 	yych = *++YYCURSOR;
 	if (yych == '\n') goto yy203;
 	goto yy197;
 yy199:
 	++YYCURSOR;
-	{ if (eoi) { RET(TOKEN_EOI); } goto singlelinecomment; }
+	{
+                        if (eoi)
+                        {
+                            if (s->report_comments)
+                                RET(TOKEN_SINGLE_COMMENT);
+                            else
+                                RET(TOKEN_EOI);
+                        }
+                        goto singlelinecomment;
+                    }
 yy201:
 	++YYCURSOR;
 	{ goto singlelinecomment; }