]> granicus.if.org Git - re2c/commitdiff
ID# 3308400: allow Yacc-style %(code brackets}%
authorpaulmcq <paulmcq@642ea486-5414-0410-9d7f-a0204ed87703>
Sun, 25 Sep 2011 23:53:45 +0000 (23:53 +0000)
committerpaulmcq <paulmcq@642ea486-5414-0410-9d7f-a0204ed87703>
Sun, 25 Sep 2011 23:53:45 +0000 (23:53 +0000)
re2c/scanner.re

index 87755cd1925872d1934048cb60351a5a496821d1..1dd6dc1000584e9635553e7ab359859081b83676 100644 (file)
@@ -64,7 +64,8 @@ Scanner::ParseMode Scanner::echo()
        tok = cursor;
 echo:
 /*!re2c
-       "/*!re2c"       {
+   beginRE     =  "%{" | "/*!re2c";
+   beginRE     {
                                        if (rFlag)
                                        {
                                                fatal("found standard 're2c' block while using -r flag");
@@ -266,7 +267,8 @@ scan:
                                        goto comment;
                                }
 
-       "*/"            {
+   endRE    =  "%}" | "*/";
+   endRE    {
                                        tok = cursor;
                                        RETURN(0);
                                }