]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1093 v7.3.1093
authorBram Moolenaar <Bram@vim.org>
Sun, 2 Jun 2013 14:07:10 +0000 (16:07 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 2 Jun 2013 14:07:10 +0000 (16:07 +0200)
Problem:    New regexp engine: When a sub expression is empty \1 skips a
            character.
Solution:   Make \1 try the current position when the match is emtpy.

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

index 11aca9c13fbdfe2ae1b37b152bc41e1d981cd0bd..8abdbb5e90dd0f5002a681574001ca78ef7240eb 100644 (file)
@@ -4435,11 +4435,10 @@ nfa_regmatch(start, submatch, m, endp)
                {
                    if (bytelen == 0)
                    {
-                       /* empty match always works, add NFA_SKIP with zero to
-                        * be used next */
-                       addstate_here(thislist, t->state->out, &t->subs,
+                       /* empty match always works, output of NFA_SKIP to be
+                        * used next */
+                       addstate_here(thislist, t->state->out->out, &t->subs,
                                                                    &listidx);
-                       thislist->t[listidx + 1].count = 0;
                    }
                    else if (bytelen <= clen)
                    {
index 78909246f79f14148f38c0b1262b5e5ab74d97c8..4d892af7c7bc3c339520308add26a2e99b702331 100644 (file)
@@ -361,6 +361,7 @@ STARTTEST
 :call add(tl, [2, '\(\i\+\) \1', ' abc abc', 'abc abc', 'abc'])
 :call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo'])
 :call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i'])
+:call add(tl, [2, '\(\d*\)a \1b', ' a b ', 'a b', ''])
 :"
 :"""" Look-behind with limit
 :call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany'])
index 31baa4f21803dacb9ae10877b3beb7d9ddc4f614..0e2f772b0026b5b113118b9db92fa224cf5e9004 100644 (file)
@@ -815,6 +815,9 @@ OK 2 - \(\i\+\) \1
 OK 0 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9
 OK 1 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9
 OK 2 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9
+OK 0 - \(\d*\)a \1b
+OK 1 - \(\d*\)a \1b
+OK 2 - \(\d*\)a \1b
 OK 0 - <\@<=span.
 OK 1 - <\@<=span.
 OK 2 - <\@<=span.
index 0e2c7282c9dc7fbbcd602161e3a33a8c717c2e2f..51daabb5a82f792b248c808913ac07fcf2702b0c 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1093,
 /**/
     1092,
 /**/