jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.002

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