]> granicus.if.org Git - re2c/commitdiff
#2506253: allow C++ // comments
authorpaulmcq <paulmcq@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 10 Jan 2011 05:29:49 +0000 (05:29 +0000)
committerpaulmcq <paulmcq@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 10 Jan 2011 05:29:49 +0000 (05:29 +0000)
re2c/scanner.re

index b777fb52a0c345107bf5b74078a5fc7edeb35305..87755cd1925872d1934048cb60351a5a496821d1 100644 (file)
@@ -258,6 +258,9 @@ scan:
                                        goto code;
                                }
 
+        "//"            {
+                               goto nextLine;
+                       }
        "/*"            {
                                        depth = 1;
                                        goto comment;
@@ -561,6 +564,22 @@ comment:
                                }
 */
 
+nextLine:
+/*!re2c                                  /* resync emacs */
+   "\n"     { if(cursor == eof) {
+                  RETURN(0);
+               }
+               tok = pos = cursor;
+               cline++;
+               goto scan;
+            }
+   any      {  if(cursor == eof) {
+                  RETURN(0);
+               }
+               goto nextLine;
+            }
+*/
+
 config:
 /*!re2c
        space+          {