3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.527
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.527
3ef2ca
Problem:    Still confusing regexp failure and NFA_TOO_EXPENSIVE.
3ef2ca
Solution:   NFA changes equivalent of 7.4.526.
3ef2ca
Files:	    src/regexp_nfa.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.526/src/regexp_nfa.c	2014-11-05 14:26:30.764758363 +0100
3ef2ca
--- src/regexp_nfa.c	2014-11-23 15:50:57.980625347 +0100
3ef2ca
***************
3ef2ca
*** 6767,6773 ****
3ef2ca
  
3ef2ca
  /*
3ef2ca
   * Try match of "prog" with at regline["col"].
3ef2ca
!  * Returns 0 for failure, number of lines contained in the match otherwise.
3ef2ca
   */
3ef2ca
      static long
3ef2ca
  nfa_regtry(prog, col)
3ef2ca
--- 6767,6773 ----
3ef2ca
  
3ef2ca
  /*
3ef2ca
   * Try match of "prog" with at regline["col"].
3ef2ca
!  * Returns <= 0 for failure, number of lines contained in the match otherwise.
3ef2ca
   */
3ef2ca
      static long
3ef2ca
  nfa_regtry(prog, col)
3ef2ca
***************
3ef2ca
*** 6897,6903 ****
3ef2ca
   * Match a regexp against a string ("line" points to the string) or multiple
3ef2ca
   * lines ("line" is NULL, use reg_getline()).
3ef2ca
   *
3ef2ca
!  * Returns 0 for failure, number of lines contained in the match otherwise.
3ef2ca
   */
3ef2ca
      static long
3ef2ca
  nfa_regexec_both(line, startcol)
3ef2ca
--- 6897,6903 ----
3ef2ca
   * Match a regexp against a string ("line" points to the string) or multiple
3ef2ca
   * lines ("line" is NULL, use reg_getline()).
3ef2ca
   *
3ef2ca
!  * Returns <= 0 for failure, number of lines contained in the match otherwise.
3ef2ca
   */
3ef2ca
      static long
3ef2ca
  nfa_regexec_both(line, startcol)
3ef2ca
***************
3ef2ca
*** 7137,7143 ****
3ef2ca
   * Uses curbuf for line count and 'iskeyword'.
3ef2ca
   * If "line_lbr" is TRUE consider a "\n" in "line" to be a line break.
3ef2ca
   *
3ef2ca
!  * Return TRUE if there is a match, FALSE if not.
3ef2ca
   */
3ef2ca
      static int
3ef2ca
  nfa_regexec_nl(rmp, line, col, line_lbr)
3ef2ca
--- 7137,7143 ----
3ef2ca
   * Uses curbuf for line count and 'iskeyword'.
3ef2ca
   * If "line_lbr" is TRUE consider a "\n" in "line" to be a line break.
3ef2ca
   *
3ef2ca
!  * Returns <= 0 for failure, number of lines contained in the match otherwise.
3ef2ca
   */
3ef2ca
      static int
3ef2ca
  nfa_regexec_nl(rmp, line, col, line_lbr)
3ef2ca
***************
3ef2ca
*** 7157,7163 ****
3ef2ca
      ireg_icombine = FALSE;
3ef2ca
  #endif
3ef2ca
      ireg_maxcol = 0;
3ef2ca
!     return (nfa_regexec_both(line, col) != 0);
3ef2ca
  }
3ef2ca
  
3ef2ca
  
3ef2ca
--- 7157,7163 ----
3ef2ca
      ireg_icombine = FALSE;
3ef2ca
  #endif
3ef2ca
      ireg_maxcol = 0;
3ef2ca
!     return nfa_regexec_both(line, col);
3ef2ca
  }
3ef2ca
  
3ef2ca
  
3ef2ca
***************
3ef2ca
*** 7166,7172 ****
3ef2ca
   * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
3ef2ca
   * Uses curbuf for line count and 'iskeyword'.
3ef2ca
   *
3ef2ca
!  * Return zero if there is no match.  Return number of lines contained in the
3ef2ca
   * match otherwise.
3ef2ca
   *
3ef2ca
   * Note: the body is the same as bt_regexec() except for nfa_regexec_both()
3ef2ca
--- 7166,7172 ----
3ef2ca
   * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
3ef2ca
   * Uses curbuf for line count and 'iskeyword'.
3ef2ca
   *
3ef2ca
!  * Return <= 0 if there is no match.  Return number of lines contained in the
3ef2ca
   * match otherwise.
3ef2ca
   *
3ef2ca
   * Note: the body is the same as bt_regexec() except for nfa_regexec_both()
3ef2ca
*** ../vim-7.4.526/src/version.c	2014-11-20 23:07:00.515474686 +0100
3ef2ca
--- src/version.c	2014-11-23 15:53:23.170981186 +0100
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     527,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
"I know that there are people who don't love their fellow man,
3ef2ca
and I hate those people!" - Tom Lehrer
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    ///