]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.1055 v7.3.1055
authorBram Moolenaar <Bram@vim.org>
Thu, 30 May 2013 09:51:08 +0000 (11:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 30 May 2013 09:51:08 +0000 (11:51 +0200)
Problem:    Negated collection does not match newline.
Solution:   Handle newline differently. (Hiroshi Shirosaki)

src/regexp_nfa.c
src/testdir/test64.in
src/testdir/test64.ok
src/version.c

index bb8c982fe77e6a7137631ff896aaba3044d4eeff..aa6c56e6aa1dfb72e515c5a88cc82d299954bf20 100644 (file)
@@ -1203,13 +1203,6 @@ collection:
                }
                mb_ptr_adv(regparse);
 
-               if (extra == ADD_NL)        /* \_[] also matches \n */
-               {
-                   EMIT(reg_string ? NL : NFA_NEWL);
-                   TRY_NEG();
-                   EMIT_GLUE();
-               }
-
                /* skip the trailing ] */
                regparse = endp;
                mb_ptr_adv(regparse);
@@ -1219,6 +1212,14 @@ collection:
                    EMIT(NFA_END_NEG_RANGE);
                    EMIT(NFA_CONCAT);
                }
+
+               /* \_[] also matches \n but it's not negated */
+               if (extra == ADD_NL)
+               {
+                   EMIT(reg_string ? NL : NFA_NEWL);
+                   EMIT(NFA_OR);
+               }
+
                return OK;
            } /* if exists closing ] */
 
index 192d456725e9d00e516511309d7cfe07330fdd89..0c551731686428d7f8244ac242fe4747b471b7ef 100644 (file)
@@ -344,8 +344,12 @@ STARTTEST
 :call add(tl, [0, '\(<<\)\@1<=span.', 'xxspanxxxx<spanxx<<spanyyy'])
 :call add(tl, [0, '\(<<\)\@2<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<'])
 :"
-:"""" Run the tests
+:"""" "\_" prepended negated collection matches EOL
+:call add(tl, [2, '\_[^8-9]\+', "asfi\n9888", "asfi\n"])
+:call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"])
+:"
 :"
+:"""" Run the tests
 :"
 :for t in tl
 :  let re = t[0]
index 74db0bd09b7fa1276c3628ed54d82deff6bf1854..7b8185306bfb751d2ccfbf2c4b674d92014ca36f 100644 (file)
@@ -731,6 +731,12 @@ OK 0 - \(<<\)\@1<=span.
 OK 1 - \(<<\)\@1<=span.
 OK 0 - \(<<\)\@2<=span.
 OK 1 - \(<<\)\@2<=span.
+OK 0 - \_[^8-9]\+
+OK 1 - \_[^8-9]\+
+OK 2 - \_[^8-9]\+
+OK 0 - \_[^a]\+
+OK 1 - \_[^a]\+
+OK 2 - \_[^a]\+
 192.168.0.1
 192.168.0.1
 192.168.0.1
index 795e175bc8594bb5375aac8ea67a6bf4eedd7ce9..651c64c588208440cd4026a5021628ed9bffcb71 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1055,
 /**/
     1054,
 /**/