8b9a1c
To: vim_dev@googlegroups.com
8b9a1c
Subject: Patch 7.4.002
8b9a1c
Fcc: outbox
8b9a1c
From: Bram Moolenaar <Bram@moolenaar.net>
8b9a1c
Mime-Version: 1.0
8b9a1c
Content-Type: text/plain; charset=UTF-8
8b9a1c
Content-Transfer-Encoding: 8bit
8b9a1c
------------
8b9a1c
8b9a1c
Patch 7.4b.002
8b9a1c
Problem:    Pattern with two alternative look-behind matches does not match.
8b9a1c
	    (Amadeus Demarzi)
8b9a1c
Solution:   When comparing PIMs also compare their state ID to see if they are
8b9a1c
	    different.
8b9a1c
Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
8b9a1c
8b9a1c
8b9a1c
*** ../vim-7.4.001/src/regexp_nfa.c	2013-08-14 12:05:54.000000000 +0200
8b9a1c
--- src/regexp_nfa.c	2013-08-14 13:12:09.000000000 +0200
8b9a1c
***************
8b9a1c
*** 3782,3787 ****
8b9a1c
--- 3782,3790 ----
8b9a1c
      if (two_unused)
8b9a1c
  	/* one is used and two is not: not equal */
8b9a1c
  	return FALSE;
8b9a1c
+     /* compare the state id */
8b9a1c
+     if (one->state->id != two->state->id)
8b9a1c
+ 	return FALSE;
8b9a1c
      /* compare the position */
8b9a1c
      if (REG_MULTI)
8b9a1c
  	return one->end.pos.lnum == two->end.pos.lnum
8b9a1c
*** ../vim-7.4.001/src/testdir/test64.in	2013-08-14 12:05:54.000000000 +0200
8b9a1c
--- src/testdir/test64.in	2013-08-14 12:58:38.000000000 +0200
8b9a1c
***************
8b9a1c
*** 421,426 ****
8b9a1c
--- 421,429 ----
8b9a1c
  :call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo'])
8b9a1c
  :call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo'])
8b9a1c
  :"
8b9a1c
+ :" complicated look-behind match
8b9a1c
+ :call add(tl, [2, '\(r\@<=\|\w\@
8b9a1c
+ :"
8b9a1c
  :""""" \@>
8b9a1c
  :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
8b9a1c
  :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
8b9a1c
*** ../vim-7.4.001/src/testdir/test64.ok	2013-08-14 12:05:54.000000000 +0200
8b9a1c
--- src/testdir/test64.ok	2013-08-14 13:14:09.000000000 +0200
8b9a1c
***************
8b9a1c
*** 974,979 ****
8b9a1c
--- 974,982 ----
8b9a1c
  OK 0 - \(foo\)\@<=.*
8b9a1c
  OK 1 - \(foo\)\@<=.*
8b9a1c
  OK 2 - \(foo\)\@<=.*
8b9a1c
+ OK 0 - \(r\@<=\|\w\@
8b9a1c
+ OK 1 - \(r\@<=\|\w\@
8b9a1c
+ OK 2 - \(r\@<=\|\w\@
8b9a1c
  OK 0 - \(a*\)\@>a
8b9a1c
  OK 1 - \(a*\)\@>a
8b9a1c
  OK 2 - \(a*\)\@>a
8b9a1c
*** ../vim-7.4.001/src/version.c	2013-08-14 12:05:54.000000000 +0200
8b9a1c
--- src/version.c	2013-08-14 13:13:45.000000000 +0200
8b9a1c
***************
8b9a1c
*** 729,730 ****
8b9a1c
--- 729,732 ----
8b9a1c
  {   /* Add new patch number below this line */
8b9a1c
+ /**/
8b9a1c
+     2,
8b9a1c
  /**/
8b9a1c
8b9a1c
-- 
8b9a1c
From "know your smileys":
8b9a1c
 :-)-O	Smiling doctor with stethoscope
8b9a1c
8b9a1c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8b9a1c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8b9a1c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
8b9a1c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///