Karsten Hopp fd0342
To: vim_dev@googlegroups.com
Karsten Hopp fd0342
Subject: Patch 7.4.527
Karsten Hopp fd0342
Fcc: outbox
Karsten Hopp fd0342
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp fd0342
Mime-Version: 1.0
Karsten Hopp fd0342
Content-Type: text/plain; charset=UTF-8
Karsten Hopp fd0342
Content-Transfer-Encoding: 8bit
Karsten Hopp fd0342
------------
Karsten Hopp fd0342
Karsten Hopp fd0342
Patch 7.4.527
Karsten Hopp fd0342
Problem:    Still confusing regexp failure and NFA_TOO_EXPENSIVE.
Karsten Hopp fd0342
Solution:   NFA changes equivalent of 7.4.526.
Karsten Hopp fd0342
Files:	    src/regexp_nfa.c
Karsten Hopp fd0342
Karsten Hopp fd0342
Karsten Hopp fd0342
*** ../vim-7.4.526/src/regexp_nfa.c	2014-11-05 14:26:30.764758363 +0100
Karsten Hopp fd0342
--- src/regexp_nfa.c	2014-11-23 15:50:57.980625347 +0100
Karsten Hopp fd0342
***************
Karsten Hopp fd0342
*** 6767,6773 ****
Karsten Hopp fd0342
  
Karsten Hopp fd0342
  /*
Karsten Hopp fd0342
   * Try match of "prog" with at regline["col"].
Karsten Hopp fd0342
!  * Returns 0 for failure, number of lines contained in the match otherwise.
Karsten Hopp fd0342
   */
Karsten Hopp fd0342
      static long
Karsten Hopp fd0342
  nfa_regtry(prog, col)
Karsten Hopp fd0342
--- 6767,6773 ----
Karsten Hopp fd0342
  
Karsten Hopp fd0342
  /*
Karsten Hopp fd0342
   * Try match of "prog" with at regline["col"].
Karsten Hopp fd0342
!  * Returns <= 0 for failure, number of lines contained in the match otherwise.
Karsten Hopp fd0342
   */
Karsten Hopp fd0342
      static long
Karsten Hopp fd0342
  nfa_regtry(prog, col)
Karsten Hopp fd0342
***************
Karsten Hopp fd0342
*** 6897,6903 ****
Karsten Hopp fd0342
   * Match a regexp against a string ("line" points to the string) or multiple
Karsten Hopp fd0342
   * lines ("line" is NULL, use reg_getline()).
Karsten Hopp fd0342
   *
Karsten Hopp fd0342
!  * Returns 0 for failure, number of lines contained in the match otherwise.
Karsten Hopp fd0342
   */
Karsten Hopp fd0342
      static long
Karsten Hopp fd0342
  nfa_regexec_both(line, startcol)
Karsten Hopp fd0342
--- 6897,6903 ----
Karsten Hopp fd0342
   * Match a regexp against a string ("line" points to the string) or multiple
Karsten Hopp fd0342
   * lines ("line" is NULL, use reg_getline()).
Karsten Hopp fd0342
   *
Karsten Hopp fd0342
!  * Returns <= 0 for failure, number of lines contained in the match otherwise.
Karsten Hopp fd0342
   */
Karsten Hopp fd0342
      static long
Karsten Hopp fd0342
  nfa_regexec_both(line, startcol)
Karsten Hopp fd0342
***************
Karsten Hopp fd0342
*** 7137,7143 ****
Karsten Hopp fd0342
   * Uses curbuf for line count and 'iskeyword'.
Karsten Hopp fd0342
   * If "line_lbr" is TRUE consider a "\n" in "line" to be a line break.
Karsten Hopp fd0342
   *
Karsten Hopp fd0342
!  * Return TRUE if there is a match, FALSE if not.
Karsten Hopp fd0342
   */
Karsten Hopp fd0342
      static int
Karsten Hopp fd0342
  nfa_regexec_nl(rmp, line, col, line_lbr)
Karsten Hopp fd0342
--- 7137,7143 ----
Karsten Hopp fd0342
   * Uses curbuf for line count and 'iskeyword'.
Karsten Hopp fd0342
   * If "line_lbr" is TRUE consider a "\n" in "line" to be a line break.
Karsten Hopp fd0342
   *
Karsten Hopp fd0342
!  * Returns <= 0 for failure, number of lines contained in the match otherwise.
Karsten Hopp fd0342
   */
Karsten Hopp fd0342
      static int
Karsten Hopp fd0342
  nfa_regexec_nl(rmp, line, col, line_lbr)
Karsten Hopp fd0342
***************
Karsten Hopp fd0342
*** 7157,7163 ****
Karsten Hopp fd0342
      ireg_icombine = FALSE;
Karsten Hopp fd0342
  #endif
Karsten Hopp fd0342
      ireg_maxcol = 0;
Karsten Hopp fd0342
!     return (nfa_regexec_both(line, col) != 0);
Karsten Hopp fd0342
  }
Karsten Hopp fd0342
  
Karsten Hopp fd0342
  
Karsten Hopp fd0342
--- 7157,7163 ----
Karsten Hopp fd0342
      ireg_icombine = FALSE;
Karsten Hopp fd0342
  #endif
Karsten Hopp fd0342
      ireg_maxcol = 0;
Karsten Hopp fd0342
!     return nfa_regexec_both(line, col);
Karsten Hopp fd0342
  }
Karsten Hopp fd0342
  
Karsten Hopp fd0342
  
Karsten Hopp fd0342
***************
Karsten Hopp fd0342
*** 7166,7172 ****
Karsten Hopp fd0342
   * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
Karsten Hopp fd0342
   * Uses curbuf for line count and 'iskeyword'.
Karsten Hopp fd0342
   *
Karsten Hopp fd0342
!  * Return zero if there is no match.  Return number of lines contained in the
Karsten Hopp fd0342
   * match otherwise.
Karsten Hopp fd0342
   *
Karsten Hopp fd0342
   * Note: the body is the same as bt_regexec() except for nfa_regexec_both()
Karsten Hopp fd0342
--- 7166,7172 ----
Karsten Hopp fd0342
   * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
Karsten Hopp fd0342
   * Uses curbuf for line count and 'iskeyword'.
Karsten Hopp fd0342
   *
Karsten Hopp fd0342
!  * Return <= 0 if there is no match.  Return number of lines contained in the
Karsten Hopp fd0342
   * match otherwise.
Karsten Hopp fd0342
   *
Karsten Hopp fd0342
   * Note: the body is the same as bt_regexec() except for nfa_regexec_both()
Karsten Hopp fd0342
*** ../vim-7.4.526/src/version.c	2014-11-20 23:07:00.515474686 +0100
Karsten Hopp fd0342
--- src/version.c	2014-11-23 15:53:23.170981186 +0100
Karsten Hopp fd0342
***************
Karsten Hopp fd0342
*** 743,744 ****
Karsten Hopp fd0342
--- 743,746 ----
Karsten Hopp fd0342
  {   /* Add new patch number below this line */
Karsten Hopp fd0342
+ /**/
Karsten Hopp fd0342
+     527,
Karsten Hopp fd0342
  /**/
Karsten Hopp fd0342
Karsten Hopp fd0342
-- 
Karsten Hopp fd0342
"I know that there are people who don't love their fellow man,
Karsten Hopp fd0342
and I hate those people!" - Tom Lehrer
Karsten Hopp fd0342
Karsten Hopp fd0342
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp fd0342
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp fd0342
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp fd0342
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///