Patch 7.4.020
Problem:    NFA engine matches too much with \@>. (John McGowan)
Solution:   When a whole pattern match is found stop searching.
Files:      src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok


*** ../vim-7.4.019/src/regexp_nfa.c     2013-08-25 17:01:36.000000000 +0200
--- src/regexp_nfa.c    2013-09-05 15:59:44.000000000 +0200
***************
*** 5322,5328 ****
                log_subsexpr(m);
  #endif
                nfa_match = TRUE;
!               break;
  
            case NFA_START_INVISIBLE:
            case NFA_START_INVISIBLE_FIRST:
--- 5322,5331 ----
                log_subsexpr(m);
  #endif
                nfa_match = TRUE;
!               /* See comment above at "goto nextchar". */
!               if (nextlist->n == 0)
!                   clen = 0;
!               goto nextchar;
  
            case NFA_START_INVISIBLE:
            case NFA_START_INVISIBLE_FIRST:
*** ../vim-7.4.019/src/testdir/test64.in        2013-08-14 13:31:03.000000000 
+0200
--- src/testdir/test64.in       2013-09-05 15:35:44.000000000 +0200
***************
*** 427,432 ****
--- 427,433 ----
  :""""" \@>
  :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
  :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
+ :call add(tl, [2, '^\(.\{-}b\)\@>.', '  abcbd', '  abc', '  ab'])
  :" TODO: BT engine does not restore submatch after failure
  :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa'])
  :"
*** ../vim-7.4.019/src/testdir/test64.ok        2013-08-14 13:31:03.000000000 
+0200
--- src/testdir/test64.ok       2013-09-05 16:03:34.000000000 +0200
***************
*** 983,988 ****
--- 983,991 ----
  OK 0 - \(a*\)\@>b
  OK 1 - \(a*\)\@>b
  OK 2 - \(a*\)\@>b
+ OK 0 - ^\(.\{-}b\)\@>.
+ OK 1 - ^\(.\{-}b\)\@>.
+ OK 2 - ^\(.\{-}b\)\@>.
  OK 0 - \(a*\)\@>a\|a\+
  OK 2 - \(a*\)\@>a\|a\+
  OK 0 - \_[^8-9]\+
*** ../vim-7.4.019/src/version.c        2013-09-05 13:50:49.000000000 +0200
--- src/version.c       2013-09-05 16:04:32.000000000 +0200
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     20,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
173. You keep tracking down the email addresses of all your friends
     (even childhood friends).

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui