Karsten Hopp 036a0d
To: vim_dev@googlegroups.com
Karsten Hopp 036a0d
Subject: Patch 7.3.1083
Karsten Hopp 036a0d
Fcc: outbox
Karsten Hopp 036a0d
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 036a0d
Mime-Version: 1.0
Karsten Hopp 036a0d
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 036a0d
Content-Transfer-Encoding: 8bit
Karsten Hopp 036a0d
------------
Karsten Hopp 036a0d
Karsten Hopp 036a0d
Patch 7.3.1083
Karsten Hopp 036a0d
Problem:    New regexp engine: Does not support \%^ and \%$.
Karsten Hopp 036a0d
Solution:   Support matching start and end of file.
Karsten Hopp 036a0d
Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
Karsten Hopp 036a0d
Karsten Hopp 036a0d
Karsten Hopp 036a0d
*** ../vim-7.3.1082/src/regexp_nfa.c	2013-05-31 21:45:05.000000000 +0200
Karsten Hopp 036a0d
--- src/regexp_nfa.c	2013-05-31 21:55:35.000000000 +0200
Karsten Hopp 036a0d
***************
Karsten Hopp 036a0d
*** 865,878 ****
Karsten Hopp 036a0d
  		 * pattern -- regardless of whether or not it makes sense. */
Karsten Hopp 036a0d
  		case '^':
Karsten Hopp 036a0d
  		    EMIT(NFA_BOF);
Karsten Hopp 036a0d
- 		    /* TODO: Not yet supported */
Karsten Hopp 036a0d
- 		    return FAIL;
Karsten Hopp 036a0d
  		    break;
Karsten Hopp 036a0d
  
Karsten Hopp 036a0d
  		case '$':
Karsten Hopp 036a0d
  		    EMIT(NFA_EOF);
Karsten Hopp 036a0d
- 		    /* TODO: Not yet supported */
Karsten Hopp 036a0d
- 		    return FAIL;
Karsten Hopp 036a0d
  		    break;
Karsten Hopp 036a0d
  
Karsten Hopp 036a0d
  		case '#':
Karsten Hopp 036a0d
--- 865,874 ----
Karsten Hopp 036a0d
***************
Karsten Hopp 036a0d
*** 1780,1785 ****
Karsten Hopp 036a0d
--- 1776,1783 ----
Karsten Hopp 036a0d
  	case NFA_BOL:		STRCPY(code, "NFA_BOL "); break;
Karsten Hopp 036a0d
  	case NFA_EOW:		STRCPY(code, "NFA_EOW "); break;
Karsten Hopp 036a0d
  	case NFA_BOW:		STRCPY(code, "NFA_BOW "); break;
Karsten Hopp 036a0d
+ 	case NFA_EOF:		STRCPY(code, "NFA_EOF "); break;
Karsten Hopp 036a0d
+ 	case NFA_BOF:		STRCPY(code, "NFA_BOF "); break;
Karsten Hopp 036a0d
  	case NFA_STAR:		STRCPY(code, "NFA_STAR "); break;
Karsten Hopp 036a0d
  	case NFA_PLUS:		STRCPY(code, "NFA_PLUS "); break;
Karsten Hopp 036a0d
  	case NFA_NOT:		STRCPY(code, "NFA_NOT "); break;
Karsten Hopp 036a0d
***************
Karsten Hopp 036a0d
*** 3705,3710 ****
Karsten Hopp 036a0d
--- 3703,3719 ----
Karsten Hopp 036a0d
  		break;
Karsten Hopp 036a0d
  	    }
Karsten Hopp 036a0d
  
Karsten Hopp 036a0d
+ 	    case NFA_BOF:
Karsten Hopp 036a0d
+ 		if (reglnum == 0 && reginput == regline
Karsten Hopp 036a0d
+ 					&& (!REG_MULTI || reg_firstlnum == 1))
Karsten Hopp 036a0d
+ 		    addstate_here(thislist, t->state->out, &t->sub, &listidx);
Karsten Hopp 036a0d
+ 		break;
Karsten Hopp 036a0d
+ 
Karsten Hopp 036a0d
+ 	    case NFA_EOF:
Karsten Hopp 036a0d
+ 		if (reglnum == reg_maxline && curc == NUL)
Karsten Hopp 036a0d
+ 		    addstate_here(thislist, t->state->out, &t->sub, &listidx);
Karsten Hopp 036a0d
+ 		break;
Karsten Hopp 036a0d
+ 
Karsten Hopp 036a0d
  #ifdef FEAT_MBYTE
Karsten Hopp 036a0d
  	    case NFA_COMPOSING:
Karsten Hopp 036a0d
  	    {
Karsten Hopp 036a0d
*** ../vim-7.3.1082/src/testdir/test64.in	2013-05-31 21:45:05.000000000 +0200
Karsten Hopp 036a0d
--- src/testdir/test64.in	2013-05-31 22:10:12.000000000 +0200
Karsten Hopp 036a0d
***************
Karsten Hopp 036a0d
*** 267,272 ****
Karsten Hopp 036a0d
--- 267,281 ----
Karsten Hopp 036a0d
  :call add(tl, [2, '\_f', "  \na ", "\n"])
Karsten Hopp 036a0d
  :call add(tl, [2, '\_f\+', "  \na ", "\na"])
Karsten Hopp 036a0d
  :"
Karsten Hopp 036a0d
+ :"""" Test start/end of line, start/end of file
Karsten Hopp 036a0d
+ :call add(tl, [2, '^a.', "a_\nb ", "a_"])
Karsten Hopp 036a0d
+ :call add(tl, [2, '^a.', "b a \na_"])
Karsten Hopp 036a0d
+ :call add(tl, [2, '.a$', " a\n "])
Karsten Hopp 036a0d
+ :call add(tl, [2, '.a$', " a b\n_a", "_a"])
Karsten Hopp 036a0d
+ :call add(tl, [2, '\%^a.', "a a\na", "a "])
Karsten Hopp 036a0d
+ :call add(tl, [2, '\%^a', " a \na "])
Karsten Hopp 036a0d
+ :call add(tl, [2, '.a\%$', " a\n "])
Karsten Hopp 036a0d
+ :call add(tl, [2, '.a\%$', " a\n_a", "_a"])
Karsten Hopp 036a0d
  :"
Karsten Hopp 036a0d
  :"""" Test recognition of some character classes
Karsten Hopp 036a0d
  :call add(tl, [2, '[0-9]', '8', '8'])
Karsten Hopp 036a0d
***************
Karsten Hopp 036a0d
*** 466,471 ****
Karsten Hopp 036a0d
--- 475,489 ----
Karsten Hopp 036a0d
  :call Postest()
Karsten Hopp 036a0d
  :put
Karsten Hopp 036a0d
  :"
Karsten Hopp 036a0d
+ :" start and end of buffer
Karsten Hopp 036a0d
+ /\%^
Karsten Hopp 036a0d
+ yeGo?p:"
Karsten Hopp 036a0d
+ 50%/\%^..
Karsten Hopp 036a0d
+ yeGo?pA END?:"
Karsten Hopp 036a0d
+ 50%/\%$
Karsten Hopp 036a0d
+ "ayb20gg/..\%$
Karsten Hopp 036a0d
+ "bybGo?"apo?"bp:"
Karsten Hopp 036a0d
+ :"
Karsten Hopp 036a0d
  :/\%#=1^Results/,$wq! test.out
Karsten Hopp 036a0d
  ENDTEST
Karsten Hopp 036a0d
  
Karsten Hopp 036a0d
*** ../vim-7.3.1082/src/testdir/test64.ok	2013-05-31 21:45:05.000000000 +0200
Karsten Hopp 036a0d
--- src/testdir/test64.ok	2013-05-31 22:10:47.000000000 +0200
Karsten Hopp 036a0d
***************
Karsten Hopp 036a0d
*** 585,590 ****
Karsten Hopp 036a0d
--- 585,614 ----
Karsten Hopp 036a0d
  OK 0 - \_f\+
Karsten Hopp 036a0d
  OK 1 - \_f\+
Karsten Hopp 036a0d
  OK 2 - \_f\+
Karsten Hopp 036a0d
+ OK 0 - ^a.
Karsten Hopp 036a0d
+ OK 1 - ^a.
Karsten Hopp 036a0d
+ OK 2 - ^a.
Karsten Hopp 036a0d
+ OK 0 - ^a.
Karsten Hopp 036a0d
+ OK 1 - ^a.
Karsten Hopp 036a0d
+ OK 2 - ^a.
Karsten Hopp 036a0d
+ OK 0 - .a$
Karsten Hopp 036a0d
+ OK 1 - .a$
Karsten Hopp 036a0d
+ OK 2 - .a$
Karsten Hopp 036a0d
+ OK 0 - .a$
Karsten Hopp 036a0d
+ OK 1 - .a$
Karsten Hopp 036a0d
+ OK 2 - .a$
Karsten Hopp 036a0d
+ OK 0 - \%^a.
Karsten Hopp 036a0d
+ OK 1 - \%^a.
Karsten Hopp 036a0d
+ OK 2 - \%^a.
Karsten Hopp 036a0d
+ OK 0 - \%^a
Karsten Hopp 036a0d
+ OK 1 - \%^a
Karsten Hopp 036a0d
+ OK 2 - \%^a
Karsten Hopp 036a0d
+ OK 0 - .a\%$
Karsten Hopp 036a0d
+ OK 1 - .a\%$
Karsten Hopp 036a0d
+ OK 2 - .a\%$
Karsten Hopp 036a0d
+ OK 0 - .a\%$
Karsten Hopp 036a0d
+ OK 1 - .a\%$
Karsten Hopp 036a0d
+ OK 2 - .a\%$
Karsten Hopp 036a0d
  OK 0 - [0-9]
Karsten Hopp 036a0d
  OK 1 - [0-9]
Karsten Hopp 036a0d
  OK 2 - [0-9]
Karsten Hopp 036a0d
***************
Karsten Hopp 036a0d
*** 818,820 ****
Karsten Hopp 036a0d
--- 842,848 ----
Karsten Hopp 036a0d
  ab!babababababfoo
Karsten Hopp 036a0d
  ba!ab##abab?bafoo
Karsten Hopp 036a0d
  **!*****_
Karsten Hopp 036a0d
+ Test
Karsten Hopp 036a0d
+ Test END
Karsten Hopp 036a0d
+ EN
Karsten Hopp 036a0d
+ E
Karsten Hopp 036a0d
*** ../vim-7.3.1082/src/version.c	2013-05-31 21:45:05.000000000 +0200
Karsten Hopp 036a0d
--- src/version.c	2013-05-31 21:57:03.000000000 +0200
Karsten Hopp 036a0d
***************
Karsten Hopp 036a0d
*** 730,731 ****
Karsten Hopp 036a0d
--- 730,733 ----
Karsten Hopp 036a0d
  {   /* Add new patch number below this line */
Karsten Hopp 036a0d
+ /**/
Karsten Hopp 036a0d
+     1083,
Karsten Hopp 036a0d
  /**/
Karsten Hopp 036a0d
Karsten Hopp 036a0d
-- 
Karsten Hopp 036a0d
Have you heard about the new Beowulf cluster? It's so fast, it executes
Karsten Hopp 036a0d
an infinite loop in 6 seconds.
Karsten Hopp 036a0d
Karsten Hopp 036a0d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 036a0d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 036a0d
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 036a0d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///