patchlevel 2, pattern with two alternative look-behind matches doesn't match

This commit is contained in:
Karsten Hopp 2013-08-21 14:33:55 +02:00
parent 5629fc1540
commit af93781c05
3 changed files with 84 additions and 1 deletions

77
7.4.002 Normal file
View File

@ -0,0 +1,77 @@
To: vim_dev@googlegroups.com
Subject: Patch 7.4.002
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 7.4b.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.
Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
*** ../vim-7.4.001/src/regexp_nfa.c 2013-08-14 12:05:54.000000000 +0200
--- src/regexp_nfa.c 2013-08-14 13:12:09.000000000 +0200
***************
*** 3782,3787 ****
--- 3782,3790 ----
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
*** ../vim-7.4.001/src/testdir/test64.in 2013-08-14 12:05:54.000000000 +0200
--- src/testdir/test64.in 2013-08-14 12:58:38.000000000 +0200
***************
*** 421,426 ****
--- 421,429 ----
: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'])
*** ../vim-7.4.001/src/testdir/test64.ok 2013-08-14 12:05:54.000000000 +0200
--- src/testdir/test64.ok 2013-08-14 13:14:09.000000000 +0200
***************
*** 974,979 ****
--- 974,982 ----
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
*** ../vim-7.4.001/src/version.c 2013-08-14 12:05:54.000000000 +0200
--- src/version.c 2013-08-14 13:13:45.000000000 +0200
***************
*** 729,730 ****
--- 729,732 ----
{ /* Add new patch number below this line */
+ /**/
+ 2,
/**/
--
From "know your smileys":
:-)-O Smiling doctor with stethoscope
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

View File

@ -25,3 +25,4 @@ Individual patches for Vim 7.4:
SIZE NAME FIXES SIZE NAME FIXES
13179 7.4.001 'ic' doesn't work for patterns such as [a-z] 13179 7.4.001 'ic' doesn't work for patterns such as [a-z]
2522 7.4.002 pattern with two alternative look-behind matches doesn't match

View File

@ -14,7 +14,7 @@
%define baseversion 7.4 %define baseversion 7.4
%define vimdir vim74 %define vimdir vim74
%define patchlevel 1 %define patchlevel 2
Summary: The VIM editor Summary: The VIM editor
URL: http://www.vim.org/ URL: http://www.vim.org/
@ -48,6 +48,7 @@ BuildRequires: hunspell-devel
# If you're as lazy as me, generate the list using # If you're as lazy as me, generate the list using
# for i in `seq 1 14`; do printf "Patch%03d: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.%03d\n" $i $i; done # for i in `seq 1 14`; do printf "Patch%03d: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.%03d\n" $i $i; done
Patch0001: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.001 Patch0001: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.001
Patch0002: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.002
Patch3000: vim-7.4-syntax.patch Patch3000: vim-7.4-syntax.patch
Patch3002: vim-7.1-nowarnings.patch Patch3002: vim-7.1-nowarnings.patch
@ -194,6 +195,7 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk
# Base patches... # Base patches...
# for i in `seq 1 14`; do printf "%%patch%03d -p0 \n" $i; done # for i in `seq 1 14`; do printf "%%patch%03d -p0 \n" $i; done
%patch001 -p0 %patch001 -p0
%patch002 -p0
# install spell files # install spell files
@ -694,6 +696,9 @@ rm -rf %{buildroot}
%{_datadir}/icons/hicolor/*/apps/* %{_datadir}/icons/hicolor/*/apps/*
%changelog %changelog
* Wed Aug 21 2013 Karsten Hopp <karsten@redhat.com> 7.4.2-1
- patchlevel 2, pattern with two alternative look-behind matches doesn't match
* Wed Aug 21 2013 Karsten Hopp <karsten@redhat.com> 7.4.1-1 * Wed Aug 21 2013 Karsten Hopp <karsten@redhat.com> 7.4.1-1
- patchlevel 1, 'ic' doesn't work for patterns such as [a-z] - patchlevel 1, 'ic' doesn't work for patterns such as [a-z]