[前][次][番号順一覧][スレッド一覧]

ruby-changes:35872

From: nagachika <ko1@a...>
Date: Thu, 16 Oct 2014 00:06:05 +0900 (JST)
Subject: [ruby-changes:35872] nagachika:r47954 (ruby_2_1): merge r47598 partially. extracted commits are as follows. [Bug #9728]

nagachika	2014-10-16 00:05:45 +0900 (Thu, 16 Oct 2014)

  New Revision: 47954

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47954

  Log:
    merge r47598 partially. extracted commits are as follows. [Bug #9728]
    https://github.com/k-takata/Onigmo/commit/15ddec6d18e27fdc1988236764e766fd5892ecf5

  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/regcomp.c
    branches/ruby_2_1/regexec.c
Index: ruby_2_1/regcomp.c
===================================================================
--- ruby_2_1/regcomp.c	(revision 47953)
+++ ruby_2_1/regcomp.c	(revision 47954)
@@ -4495,6 +4495,9 @@ concat_opt_anc_info(OptAncInfo* to, OptA https://github.com/ruby/ruby/blob/trunk/ruby_2_1/regcomp.c#L4495
   if (right_len == 0) {
     to->right_anchor |= left->right_anchor;
   }
+  else {
+    to->right_anchor |= (left->right_anchor & ANCHOR_PREC_READ_NOT);
+  }
 }
 
 static int
@@ -5068,7 +5071,8 @@ optimize_node_left(Node* node, NodeOptIn https://github.com/ruby/ruby/blob/trunk/ruby_2_1/regcomp.c#L5071
     case ANCHOR_END_BUF:
     case ANCHOR_SEMI_END_BUF:
     case ANCHOR_END_LINE:
-    case ANCHOR_LOOK_BEHIND: /* just for (?<=x).* */
+    case ANCHOR_LOOK_BEHIND:	/* just for (?<=x).* */
+    case ANCHOR_PREC_READ_NOT:	/* just for (?!x).* */
       add_opt_anc_info(&opt->anc, NANCHOR(node)->type);
       break;
 
@@ -5091,7 +5095,6 @@ optimize_node_left(Node* node, NodeOptIn https://github.com/ruby/ruby/blob/trunk/ruby_2_1/regcomp.c#L5095
       }
       break;
 
-    case ANCHOR_PREC_READ_NOT:
     case ANCHOR_LOOK_BEHIND_NOT:
       break;
     }
@@ -5357,7 +5360,8 @@ set_optimize_info_from_tree(Node* node, https://github.com/ruby/ruby/blob/trunk/ruby_2_1/regcomp.c#L5360
         ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML |
         ANCHOR_LOOK_BEHIND);
 
-  reg->anchor |= opt.anc.right_anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF);
+  reg->anchor |= opt.anc.right_anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF |
+	ANCHOR_PREC_READ_NOT);
 
   if (reg->anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)) {
     reg->anchor_dmin = opt.len.min;
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 47953)
+++ ruby_2_1/ChangeLog	(revision 47954)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Wed Oct 15 23:58:13 2014  CHIKANAGA Tomoyuki  <nagachika@r...>
+
+	merge r47598 partially. extracted commits are as follows. [Bug #9728]
+	https://github.com/k-takata/Onigmo/commit/15ddec6d18e27fdc1988236764e766fd5892ecf5
+
 Wed Oct 15 23:50:33 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* lib/fileutils.rb: handle ENOENT error with symlink targeted to
Index: ruby_2_1/regexec.c
===================================================================
--- ruby_2_1/regexec.c	(revision 47953)
+++ ruby_2_1/regexec.c	(revision 47954)
@@ -4184,7 +4184,7 @@ onig_search_gpos(regex_t* reg, const UCh https://github.com/ruby/ruby/blob/trunk/ruby_2_1/regexec.c#L4184
             prev = s;
             s += enclen(reg->enc, s, end);
 
-            if ((reg->anchor & ANCHOR_LOOK_BEHIND) == 0) {
+            if ((reg->anchor & (ANCHOR_LOOK_BEHIND | ANCHOR_PREC_READ_NOT)) == 0) {
               while (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, reg->options, 0)
                      && s < range) {
                 prev = s;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]