mojoshader_lexer.re
changeset 1121 4142681f9fda
parent 959 8a5d46db0cc6
child 1123 3d842e7dd6ad
--- a/mojoshader_lexer.re	Thu Feb 14 00:15:14 2013 -0500
+++ b/mojoshader_lexer.re	Thu Feb 14 00:46:12 2013 -0500
@@ -169,7 +169,9 @@
 // The "*\/" is just to avoid screwing up text editor syntax highlighting.
 /*!re2c
     "*\/"           {
-                        if (saw_newline)
+                        if (s->report_comments)
+                            RET(TOKEN_MULTI_COMMENT);
+                        else if (saw_newline)
                             RET('\n');
                         else if (s->report_whitespace)
                             RET(' ');
@@ -193,8 +195,23 @@
     if (YYLIMIT == YYCURSOR) YYFILL(1);
     matchptr = cursor;
 /*!re2c
-    NEWLINE         { s->line++; token = matchptr; RET('\n'); }
-    "\000"          { if (eoi) { RET(TOKEN_EOI); } goto singlelinecomment; }
+    NEWLINE         {
+                        s->line++;
+                        if (s->report_comments)
+                            RET(TOKEN_SINGLE_COMMENT);
+                        token = matchptr;
+                        RET('\n');
+                    }
+    "\000"          {
+                        if (eoi)
+                        {
+                            if (s->report_comments)
+                                RET(TOKEN_SINGLE_COMMENT);
+                            else
+                                RET(TOKEN_EOI);
+                        }
+                        goto singlelinecomment;
+                    }
     ANY             { goto singlelinecomment; }
 */