Mercurial > vim
changeset 5298:e29f11399cce v7.4.002
updated for version 7.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.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 14 Aug 2013 13:34:25 +0200 |
parents | a333c18d7048 |
children | 07307891e4ec |
files | src/regexp_nfa.c src/testdir/test64.in src/testdir/test64.ok src/version.c |
diffstat | 4 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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'])