summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2013-06-02 16:07:10 +0200
committerBram Moolenaar <bram@vim.org>2013-06-02 16:07:10 +0200
commit3e7ef91f885db1eb5a012ea60106929cded192d5 (patch)
treeaf75f73d6ab175794bf8d0baeb4889839f1a8793
parent28a25f9b83b9d418623f7037f08837041b827c90 (diff)
downloadvim-3e7ef91f885db1eb5a012ea60106929cded192d5.tar.gz
updated for version 7.3.1093v7.3.1093v7-3-1093
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.
-rw-r--r--src/regexp_nfa.c7
-rw-r--r--src/testdir/test64.in1
-rw-r--r--src/testdir/test64.ok3
-rw-r--r--src/version.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 11aca9c1..8abdbb5e 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -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)
{
diff --git a/src/testdir/test64.in b/src/testdir/test64.in
index 78909246..4d892af7 100644
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -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'])
diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok
index 31baa4f2..0e2f772b 100644
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -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.
diff --git a/src/version.c b/src/version.c
index 0e2c7282..51daabb5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1093,
+/**/
1092,
/**/
1091,