Issue #2052 has been updated by Yui NARUSE.


diff --git a/parse.y b/parse.y
index 754b363..85b7e79 100644
--- a/parse.y
+++ b/parse.y
@@ -5588,6 +5588,7 @@ static int
 parser_regx_options(struct parser_params *parser)
 {
     int kcode = 0;
+    int kopt = 0;
     int options = 0;
     int c, opt, kc;

@@ -5597,13 +5598,14 @@ parser_regx_options(struct parser_params *parser)
             options |= RE_OPTION_ONCE;
         }
         else if (rb_char_to_option_kcode(c, &opt, &kc)) {
-            options |= opt;
+            kopt = opt;
            if (kc >= 0) kcode = c;
         }
         else {
            tokadd(c);
         }
     }
+    options |= kopt;
     pushback(c);
     if (toklen()) {
        tokfix();
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2052

----------------------------------------
http://redmine.ruby-lang.org