Karsten Hopp a42e09
To: vim_dev@googlegroups.com
Karsten Hopp a42e09
Subject: Patch 7.3.1104
Karsten Hopp a42e09
Fcc: outbox
Karsten Hopp a42e09
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp a42e09
Mime-Version: 1.0
Karsten Hopp a42e09
Content-Type: text/plain; charset=UTF-8
Karsten Hopp a42e09
Content-Transfer-Encoding: 8bit
Karsten Hopp a42e09
------------
Karsten Hopp a42e09
Karsten Hopp a42e09
Patch 7.3.1104
Karsten Hopp a42e09
Problem:    New regexp engine does not handle "~".
Karsten Hopp a42e09
Solution:   Add support for "~".
Karsten Hopp a42e09
Files:	    src/regexp_nfa.c, src/testdir/test24.in, src/testdir/test24.ok
Karsten Hopp a42e09
Karsten Hopp a42e09
Karsten Hopp a42e09
*** ../vim-7.3.1103/src/regexp_nfa.c	2013-06-02 21:30:00.000000000 +0200
Karsten Hopp a42e09
--- src/regexp_nfa.c	2013-06-02 22:00:21.000000000 +0200
Karsten Hopp a42e09
***************
Karsten Hopp a42e09
*** 829,837 ****
Karsten Hopp a42e09
  	    EMSGN(_(e_misplaced), no_Magic(c));
Karsten Hopp a42e09
  	    return FAIL;
Karsten Hopp a42e09
  
Karsten Hopp a42e09
! 	case Magic('~'):		/* previous substitute pattern */
Karsten Hopp a42e09
! 	    /* TODO: Not supported yet */
Karsten Hopp a42e09
! 	    return FAIL;
Karsten Hopp a42e09
  
Karsten Hopp a42e09
  	case Magic('1'):
Karsten Hopp a42e09
  	case Magic('2'):
Karsten Hopp a42e09
--- 829,854 ----
Karsten Hopp a42e09
  	    EMSGN(_(e_misplaced), no_Magic(c));
Karsten Hopp a42e09
  	    return FAIL;
Karsten Hopp a42e09
  
Karsten Hopp a42e09
! 	case Magic('~'):
Karsten Hopp a42e09
! 	    {
Karsten Hopp a42e09
! 		char_u	    *lp;
Karsten Hopp a42e09
! 
Karsten Hopp a42e09
! 		/* Previous substitute pattern.
Karsten Hopp a42e09
! 		 * Generated as "\%(pattern\)". */
Karsten Hopp a42e09
! 		if (reg_prev_sub == NULL)
Karsten Hopp a42e09
! 		{
Karsten Hopp a42e09
! 		    EMSG(_(e_nopresub));
Karsten Hopp a42e09
! 		    return FAIL;
Karsten Hopp a42e09
! 		}
Karsten Hopp a42e09
! 		for (lp = reg_prev_sub; *lp != NUL; mb_cptr_adv(lp))
Karsten Hopp a42e09
! 		{
Karsten Hopp a42e09
! 		    EMIT(PTR2CHAR(lp));
Karsten Hopp a42e09
! 		    if (lp != reg_prev_sub)
Karsten Hopp a42e09
! 			EMIT(NFA_CONCAT);
Karsten Hopp a42e09
! 		}
Karsten Hopp a42e09
! 		EMIT(NFA_NOPEN);
Karsten Hopp a42e09
! 		break;
Karsten Hopp a42e09
! 	    }
Karsten Hopp a42e09
  
Karsten Hopp a42e09
  	case Magic('1'):
Karsten Hopp a42e09
  	case Magic('2'):
Karsten Hopp a42e09
*** ../vim-7.3.1103/src/testdir/test24.in	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp a42e09
--- src/testdir/test24.in	2013-06-02 22:03:23.000000000 +0200
Karsten Hopp a42e09
***************
Karsten Hopp a42e09
*** 44,49 ****
Karsten Hopp a42e09
--- 44,56 ----
Karsten Hopp a42e09
  :s/^\(\h\w*\%(->\|\.\)\=\)\+=/XX/
Karsten Hopp a42e09
  
Karsten Hopp a42e09
  :s/^\(\h\w*\%(->\|\.\)\=\)\+=/YY/
Karsten Hopp a42e09
+ 
Karsten Hopp a42e09
+ :s/aaa/xyz/
Karsten Hopp a42e09
+ 
Karsten Hopp a42e09
+ :s/~/bcd/
Karsten Hopp a42e09
+ 
Karsten Hopp a42e09
+ :s/~\+/BB/
Karsten Hopp a42e09
+ :"
Karsten Hopp a42e09
  :?start?,$w! test.out
Karsten Hopp a42e09
  :qa!
Karsten Hopp a42e09
  ENDTEST
Karsten Hopp a42e09
***************
Karsten Hopp a42e09
*** 77,79 ****
Karsten Hopp a42e09
--- 84,89 ----
Karsten Hopp a42e09
  xx an file xx
Karsten Hopp a42e09
  x= 9;
Karsten Hopp a42e09
  hh= 77;
Karsten Hopp a42e09
+  aaa 
Karsten Hopp a42e09
+  xyz
Karsten Hopp a42e09
+  bcdbcdbcd
Karsten Hopp a42e09
*** ../vim-7.3.1103/src/testdir/test24.ok	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp a42e09
--- src/testdir/test24.ok	2013-06-02 22:03:36.000000000 +0200
Karsten Hopp a42e09
***************
Karsten Hopp a42e09
*** 27,29 ****
Karsten Hopp a42e09
--- 27,32 ----
Karsten Hopp a42e09
  xx an A xx
Karsten Hopp a42e09
  XX 9;
Karsten Hopp a42e09
  YY 77;
Karsten Hopp a42e09
+  xyz 
Karsten Hopp a42e09
+  bcd
Karsten Hopp a42e09
+  BB
Karsten Hopp a42e09
*** ../vim-7.3.1103/src/version.c	2013-06-02 21:30:00.000000000 +0200
Karsten Hopp a42e09
--- src/version.c	2013-06-02 22:07:20.000000000 +0200
Karsten Hopp a42e09
***************
Karsten Hopp a42e09
*** 730,731 ****
Karsten Hopp a42e09
--- 730,733 ----
Karsten Hopp a42e09
  {   /* Add new patch number below this line */
Karsten Hopp a42e09
+ /**/
Karsten Hopp a42e09
+     1104,
Karsten Hopp a42e09
  /**/
Karsten Hopp a42e09
Karsten Hopp a42e09
-- 
Karsten Hopp a42e09
Q: What is a patch 22?
Karsten Hopp a42e09
A: A patch you need to include to make it possible to include patches.
Karsten Hopp a42e09
Karsten Hopp a42e09
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp a42e09
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp a42e09
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp a42e09
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///