summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-08-14 13:34:25 +0200
committerBram Moolenaar <Bram@vim.org>2013-08-14 13:34:25 +0200
commit3f0df06c2860788c6591b03e38b7dcd5bcfd27a6 (patch)
tree4dd7a840e3f6ec5ce405a35c409e8f05b492d739
parent1cfad52a03dc391435d32ad49b2ebb9eeb0df841 (diff)
downloadvim-git-3f0df06c2860788c6591b03e38b7dcd5bcfd27a6.tar.gz
updated for version 7.4.002v7.4.002
Problem: Pattern with two alternative look-behind matches does not match. (Amadeus Demarzi) Solution: When comparing PIMs also compare their state ID to see if they are different.
-rw-r--r--src/regexp_nfa.c3
-rw-r--r--src/testdir/test64.in3
-rw-r--r--src/testdir/test64.ok3
-rw-r--r--src/version.c2
4 files changed, 11 insertions, 0 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 0e172c8ca..203d9ff64 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -3782,6 +3782,9 @@ pim_equal(one, two)
if (two_unused)
/* one is used and two is not: not equal */
return FALSE;
+ /* compare the state id */
+ if (one->state->id != two->state->id)
+ return FALSE;
/* compare the position */
if (REG_MULTI)
return one->end.pos.lnum == two->end.pos.lnum
diff --git a/src/testdir/test64.in b/src/testdir/test64.in
index b29fe76f2..ac3f13d54 100644
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -421,6 +421,9 @@ STARTTEST
:call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo'])
:call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo'])
:"
+:" complicated look-behind match
+:call add(tl, [2, '\(r\@<=\|\w\@<!\)\/', 'x = /word/;', '/'])
+:"
:""""" \@>
:call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
:call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok
index 733ad8703..da19c0423 100644
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -974,6 +974,9 @@ OK 2 - \(foo\)\@<=\>
OK 0 - \(foo\)\@<=.*
OK 1 - \(foo\)\@<=.*
OK 2 - \(foo\)\@<=.*
+OK 0 - \(r\@<=\|\w\@<!\)\/
+OK 1 - \(r\@<=\|\w\@<!\)\/
+OK 2 - \(r\@<=\|\w\@<!\)\/
OK 0 - \(a*\)\@>a
OK 1 - \(a*\)\@>a
OK 2 - \(a*\)\@>a
diff --git a/src/version.c b/src/version.c
index 8eccd3cf0..f23fd0d78 100644
--- a/src/version.c
+++ b/src/version.c
@@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2,
+/**/
1,
/**/
0