3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.020
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.020
3ef2ca
Problem:    NFA engine matches too much with \@>. (John McGowan)
3ef2ca
Solution:   When a whole pattern match is found stop searching.
3ef2ca
Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.019/src/regexp_nfa.c	2013-08-25 17:01:36.000000000 +0200
3ef2ca
--- src/regexp_nfa.c	2013-09-05 15:59:44.000000000 +0200
3ef2ca
***************
3ef2ca
*** 5322,5328 ****
3ef2ca
  		log_subsexpr(m);
3ef2ca
  #endif
3ef2ca
  		nfa_match = TRUE;
3ef2ca
! 		break;
3ef2ca
  
3ef2ca
  	    case NFA_START_INVISIBLE:
3ef2ca
  	    case NFA_START_INVISIBLE_FIRST:
3ef2ca
--- 5322,5331 ----
3ef2ca
  		log_subsexpr(m);
3ef2ca
  #endif
3ef2ca
  		nfa_match = TRUE;
3ef2ca
! 		/* See comment above at "goto nextchar". */
3ef2ca
! 		if (nextlist->n == 0)
3ef2ca
! 		    clen = 0;
3ef2ca
! 		goto nextchar;
3ef2ca
  
3ef2ca
  	    case NFA_START_INVISIBLE:
3ef2ca
  	    case NFA_START_INVISIBLE_FIRST:
3ef2ca
*** ../vim-7.4.019/src/testdir/test64.in	2013-08-14 13:31:03.000000000 +0200
3ef2ca
--- src/testdir/test64.in	2013-09-05 15:35:44.000000000 +0200
3ef2ca
***************
3ef2ca
*** 427,432 ****
3ef2ca
--- 427,433 ----
3ef2ca
  :""""" \@>
3ef2ca
  :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
3ef2ca
  :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
3ef2ca
+ :call add(tl, [2, '^\(.\{-}b\)\@>.', '  abcbd', '  abc', '  ab'])
3ef2ca
  :" TODO: BT engine does not restore submatch after failure
3ef2ca
  :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa'])
3ef2ca
  :"
3ef2ca
*** ../vim-7.4.019/src/testdir/test64.ok	2013-08-14 13:31:03.000000000 +0200
3ef2ca
--- src/testdir/test64.ok	2013-09-05 16:03:34.000000000 +0200
3ef2ca
***************
3ef2ca
*** 983,988 ****
3ef2ca
--- 983,991 ----
3ef2ca
  OK 0 - \(a*\)\@>b
3ef2ca
  OK 1 - \(a*\)\@>b
3ef2ca
  OK 2 - \(a*\)\@>b
3ef2ca
+ OK 0 - ^\(.\{-}b\)\@>.
3ef2ca
+ OK 1 - ^\(.\{-}b\)\@>.
3ef2ca
+ OK 2 - ^\(.\{-}b\)\@>.
3ef2ca
  OK 0 - \(a*\)\@>a\|a\+
3ef2ca
  OK 2 - \(a*\)\@>a\|a\+
3ef2ca
  OK 0 - \_[^8-9]\+
3ef2ca
*** ../vim-7.4.019/src/version.c	2013-09-05 13:50:49.000000000 +0200
3ef2ca
--- src/version.c	2013-09-05 16:04:32.000000000 +0200
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     20,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
173. You keep tracking down the email addresses of all your friends
3ef2ca
     (even childhood friends).
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///