|
Karsten Hopp |
c915e4 |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
c915e4 |
Subject: Patch 7.3.1024
|
|
Karsten Hopp |
c915e4 |
Fcc: outbox
|
|
Karsten Hopp |
c915e4 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
c915e4 |
Mime-Version: 1.0
|
|
Karsten Hopp |
c915e4 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
c915e4 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
c915e4 |
------------
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
Patch 7.3.1024
|
|
Karsten Hopp |
c915e4 |
Problem: New regexp: End of matching pattern not set correctly. (Cesar
|
|
Karsten Hopp |
c915e4 |
Romani)
|
|
Karsten Hopp |
c915e4 |
Solution: Quit the loop after finding the match. Store nfa_has_zend in the
|
|
Karsten Hopp |
c915e4 |
program.
|
|
Karsten Hopp |
c915e4 |
Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok,
|
|
Karsten Hopp |
c915e4 |
src/regexp.h
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
*** ../vim-7.3.1023/src/regexp_nfa.c 2013-05-26 15:14:49.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
--- src/regexp_nfa.c 2013-05-26 16:51:44.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 2651,2657 ****
|
|
Karsten Hopp |
c915e4 |
break;
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
case NFA_MCLOSE + 0:
|
|
Karsten Hopp |
c915e4 |
! if (nfa_has_zend == TRUE)
|
|
Karsten Hopp |
c915e4 |
{
|
|
Karsten Hopp |
c915e4 |
addstate(l, state->out, m, off, lid, match);
|
|
Karsten Hopp |
c915e4 |
break;
|
|
Karsten Hopp |
c915e4 |
--- 2651,2657 ----
|
|
Karsten Hopp |
c915e4 |
break;
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
case NFA_MCLOSE + 0:
|
|
Karsten Hopp |
c915e4 |
! if (nfa_has_zend)
|
|
Karsten Hopp |
c915e4 |
{
|
|
Karsten Hopp |
c915e4 |
addstate(l, state->out, m, off, lid, match);
|
|
Karsten Hopp |
c915e4 |
break;
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 3109,3115 ****
|
|
Karsten Hopp |
c915e4 |
fprintf(log_fd, "\n");
|
|
Karsten Hopp |
c915e4 |
#endif
|
|
Karsten Hopp |
c915e4 |
/* Found the left-most longest match, do not look at any other
|
|
Karsten Hopp |
c915e4 |
! * states at this position. */
|
|
Karsten Hopp |
c915e4 |
goto nextchar;
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
case NFA_END_INVISIBLE:
|
|
Karsten Hopp |
c915e4 |
--- 3109,3119 ----
|
|
Karsten Hopp |
c915e4 |
fprintf(log_fd, "\n");
|
|
Karsten Hopp |
c915e4 |
#endif
|
|
Karsten Hopp |
c915e4 |
/* Found the left-most longest match, do not look at any other
|
|
Karsten Hopp |
c915e4 |
! * states at this position. When the list of states is going
|
|
Karsten Hopp |
c915e4 |
! * to be empty quit without advancing, so that "reginput" is
|
|
Karsten Hopp |
c915e4 |
! * correct. */
|
|
Karsten Hopp |
c915e4 |
! if (nextlist->n == 0 && neglist->n == 0)
|
|
Karsten Hopp |
c915e4 |
! clen = 0;
|
|
Karsten Hopp |
c915e4 |
goto nextchar;
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
case NFA_END_INVISIBLE:
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 3783,3790 ****
|
|
Karsten Hopp |
c915e4 |
regline = line;
|
|
Karsten Hopp |
c915e4 |
reglnum = 0; /* relative to line */
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
! nstate = prog->nstate;
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
for (i = 0; i < nstate; ++i)
|
|
Karsten Hopp |
c915e4 |
{
|
|
Karsten Hopp |
c915e4 |
prog->state[i].id = i;
|
|
Karsten Hopp |
c915e4 |
--- 3787,3795 ----
|
|
Karsten Hopp |
c915e4 |
regline = line;
|
|
Karsten Hopp |
c915e4 |
reglnum = 0; /* relative to line */
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
! nfa_has_zend = prog->has_zend;
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
+ nstate = prog->nstate;
|
|
Karsten Hopp |
c915e4 |
for (i = 0; i < nstate; ++i)
|
|
Karsten Hopp |
c915e4 |
{
|
|
Karsten Hopp |
c915e4 |
prog->state[i].id = i;
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 3871,3876 ****
|
|
Karsten Hopp |
c915e4 |
--- 3876,3882 ----
|
|
Karsten Hopp |
c915e4 |
prog->regflags = regflags;
|
|
Karsten Hopp |
c915e4 |
prog->engine = &nfa_regengine;
|
|
Karsten Hopp |
c915e4 |
prog->nstate = nstate;
|
|
Karsten Hopp |
c915e4 |
+ prog->has_zend = nfa_has_zend;
|
|
Karsten Hopp |
c915e4 |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
c915e4 |
nfa_postfix_dump(expr, OK);
|
|
Karsten Hopp |
c915e4 |
nfa_dump(prog);
|
|
Karsten Hopp |
c915e4 |
*** ../vim-7.3.1023/src/testdir/test64.in 2013-05-25 23:15:21.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
--- src/testdir/test64.in 2013-05-26 16:50:38.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 15,25 ****
|
|
Karsten Hopp |
c915e4 |
:" etc.
|
|
Karsten Hopp |
c915e4 |
:" When there is no match use only the first two items.
|
|
Karsten Hopp |
c915e4 |
:let tl = []
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
:"""" Previously written tests """"""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'ab', 'aab', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'b', 'abcdef', 'b'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'bc*', 'abccccdef', 'bcccc'])
|
|
Karsten Hopp |
c915e4 |
--- 15,25 ----
|
|
Karsten Hopp |
c915e4 |
:" etc.
|
|
Karsten Hopp |
c915e4 |
:" When there is no match use only the first two items.
|
|
Karsten Hopp |
c915e4 |
:let tl = []
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
:"""" Previously written tests """"""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'ab', 'aab', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'b', 'abcdef', 'b'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'bc*', 'abccccdef', 'bcccc'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 138,153 ****
|
|
Karsten Hopp |
c915e4 |
:"
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x', 'abcdef'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
:""""" Simple tests """""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:" Search single groups
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'ab', 'aab', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'ab', 'baced'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'ab', ' ab ', 'ab'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:" Search multi-modifiers
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x*', 'xcd', 'x'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx'])
|
|
Karsten Hopp |
c915e4 |
--- 138,153 ----
|
|
Karsten Hopp |
c915e4 |
:"
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x', 'abcdef'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
:""""" Simple tests """""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:" Search single groups
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'ab', 'aab', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'ab', 'baced'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'ab', ' ab ', 'ab'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:" Search multi-modifiers
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x*', 'xcd', 'x'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 162,168 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x\?', 'x sdfoij', 'x'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x\?', 'abc sfoij', '']) " empty match is good
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{0,0}', 'abcdfdoij', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?'
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}'
|
|
Karsten Hopp |
c915e4 |
--- 162,168 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x\?', 'x sdfoij', 'x'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x\?', 'abc sfoij', '']) " empty match is good
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{0,0}', 'abcdfdoij', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?'
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}'
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 182,188 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*'
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?'
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-3,6}', 'aa siofuh'])
|
|
Karsten Hopp |
c915e4 |
--- 182,188 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*'
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?'
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-3,6}', 'aa siofuh'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 200,206 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*'
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', ''])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:" Test groups of characters and submatches
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab'])
|
|
Karsten Hopp |
c915e4 |
--- 200,206 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*'
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', ''])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:" Test groups of characters and submatches
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 213,219 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', ''])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:" Test greedy-ness and lazy-ness
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa'])
|
|
Karsten Hopp |
c915e4 |
--- 213,219 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', ''])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:" Test greedy-ness and lazy-ness
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 221,230 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa',''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a{-1,3})+','aa','aa','a'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:" Test Character classes
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:" Test collections and character range []
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v[a]', 'abcd', 'a'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a[bcd]', 'abcd', 'ab'])
|
|
Karsten Hopp |
c915e4 |
--- 221,230 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa',''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a{-1,3})+','aa','aa','a'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:" Test Character classes
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:" Test collections and character range []
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v[a]', 'abcd', 'a'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'a[bcd]', 'abcd', 'ab'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 250,257 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:"""" Test recognition of some character classes
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[0-9]', '8', '8'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[^0-9]', '8'])
|
|
Karsten Hopp |
c915e4 |
--- 250,257 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:"""" Test recognition of some character classes
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[0-9]', '8', '8'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[^0-9]', '8'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 262,268 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[a-zA-Z]', 'a', 'a'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[A-Z]', 'a'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:"""" Tests for \z features
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'xx \ze test', 'xx ']) " must match after \ze
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'abc\zeend', 'oij abcend', 'abc'])
|
|
Karsten Hopp |
c915e4 |
--- 262,268 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[a-zA-Z]', 'a', 'a'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[A-Z]', 'a'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:"""" Tests for \z features
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'xx \ze test', 'xx ']) " must match after \ze
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'abc\zeend', 'oij abcend', 'abc'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 271,277 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\>\zs.', 'aword. ', '.'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:"""" Tests for \@ features
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'abc\@=', 'abc', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd'])
|
|
Karsten Hopp |
c915e4 |
--- 271,277 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\>\zs.', 'aword. ', '.'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:"""" Tests for \@ features
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'abc\@=', 'abc', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd'])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 284,290 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) " no match
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:"""" Combining different tests and features
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '', 'abcd', ''])
|
|
Karsten Hopp |
c915e4 |
--- 284,290 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) " no match
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:"""" Combining different tests and features
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '', 'abcd', ''])
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 292,313 ****
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(test|)empty', 'tesempty', 'empty', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a'])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:"""" \%u and friends
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%d32', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%o40', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%x20', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%u0020', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%U00000020', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:"""" Alternatives, must use first longest match
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'goo\|go', 'google', 'goo'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:"""" Run the tests
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:"
|
|
Karsten Hopp |
c915e4 |
:for t in tl
|
|
Karsten Hopp |
c915e4 |
: let re = t[0]
|
|
Karsten Hopp |
c915e4 |
--- 292,313 ----
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(test|)empty', 'tesempty', 'empty', ''])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a'])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:"""" \%u and friends
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%d32', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%o40', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%x20', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%u0020', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\%U00000020', 'yes no', ' '])
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:"""" Alternatives, must use first longest match
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, 'goo\|go', 'google', 'goo'])
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\
|
|
Karsten Hopp |
c915e4 |
:call add(tl, [2, '\
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:"""" Run the tests
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:"
|
|
Karsten Hopp |
c915e4 |
:for t in tl
|
|
Karsten Hopp |
c915e4 |
: let re = t[0]
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 347,353 ****
|
|
Karsten Hopp |
c915e4 |
: endfor
|
|
Karsten Hopp |
c915e4 |
:endfor
|
|
Karsten Hopp |
c915e4 |
:unlet t tl e l
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:" Check that \_[0-9] matching EOL does not break a following \>
|
|
Karsten Hopp |
c915e4 |
:" This only works on a buffer line, not with expression evaluation
|
|
Karsten Hopp |
c915e4 |
/^Find this
|
|
Karsten Hopp |
c915e4 |
--- 347,353 ----
|
|
Karsten Hopp |
c915e4 |
: endfor
|
|
Karsten Hopp |
c915e4 |
:endfor
|
|
Karsten Hopp |
c915e4 |
:unlet t tl e l
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:" Check that \_[0-9] matching EOL does not break a following \>
|
|
Karsten Hopp |
c915e4 |
:" This only works on a buffer line, not with expression evaluation
|
|
Karsten Hopp |
c915e4 |
/^Find this
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 359,369 ****
|
|
Karsten Hopp |
c915e4 |
/^Find this
|
|
Karsten Hopp |
c915e4 |
/\%#=2\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>
|
|
Karsten Hopp |
c915e4 |
y$Go?p:"
|
|
Karsten Hopp |
c915e4 |
!
|
|
Karsten Hopp |
c915e4 |
:/\%#=1^Results/,$wq! test.out
|
|
Karsten Hopp |
c915e4 |
ENDTEST
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
Find this:
|
|
Karsten Hopp |
c915e4 |
localnet/192.168.0.1
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
Results of test64:
|
|
Karsten Hopp |
c915e4 |
--- 359,383 ----
|
|
Karsten Hopp |
c915e4 |
/^Find this
|
|
Karsten Hopp |
c915e4 |
/\%#=2\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>
|
|
Karsten Hopp |
c915e4 |
y$Go?p:"
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
! :" Check that using a pattern on two lines doesn't get messed up by using
|
|
Karsten Hopp |
c915e4 |
! :" matchstr() with \ze in between.
|
|
Karsten Hopp |
c915e4 |
! :set re=0
|
|
Karsten Hopp |
c915e4 |
! /^Substitute here
|
|
Karsten Hopp |
c915e4 |
! :.+1,.+2s/""/\='"'.matchstr(getline("."), '\d\+\ze<').'"'
|
|
Karsten Hopp |
c915e4 |
! /^Substitute here
|
|
Karsten Hopp |
c915e4 |
! :.+1,.+2yank
|
|
Karsten Hopp |
c915e4 |
! Go?p:"
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
! :"
|
|
Karsten Hopp |
c915e4 |
:/\%#=1^Results/,$wq! test.out
|
|
Karsten Hopp |
c915e4 |
ENDTEST
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
Find this:
|
|
Karsten Hopp |
c915e4 |
localnet/192.168.0.1
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
+ Substitute here:
|
|
Karsten Hopp |
c915e4 |
+ <T="">Ta 5</Title>
|
|
Karsten Hopp |
c915e4 |
+ <T="">Ac 7</Title>
|
|
Karsten Hopp |
c915e4 |
+
|
|
Karsten Hopp |
c915e4 |
Results of test64:
|
|
Karsten Hopp |
c915e4 |
*** ../vim-7.3.1023/src/testdir/test64.ok 2013-05-25 23:15:21.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
--- src/testdir/test64.ok 2013-05-26 16:42:18.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 693,695 ****
|
|
Karsten Hopp |
c915e4 |
--- 693,698 ----
|
|
Karsten Hopp |
c915e4 |
192.168.0.1
|
|
Karsten Hopp |
c915e4 |
192.168.0.1
|
|
Karsten Hopp |
c915e4 |
192.168.0.1
|
|
Karsten Hopp |
c915e4 |
+
|
|
Karsten Hopp |
c915e4 |
+ <T="5">Ta 5</Title>
|
|
Karsten Hopp |
c915e4 |
+ <T="7">Ac 7</Title>
|
|
Karsten Hopp |
c915e4 |
*** ../vim-7.3.1023/src/regexp.h 2013-05-25 20:19:45.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
--- src/regexp.h 2013-05-26 16:30:50.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 86,91 ****
|
|
Karsten Hopp |
c915e4 |
--- 86,92 ----
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
regprog_T regprog;
|
|
Karsten Hopp |
c915e4 |
nfa_state_T *start;
|
|
Karsten Hopp |
c915e4 |
+ int has_zend; /* pattern contains \ze */
|
|
Karsten Hopp |
c915e4 |
int nstate;
|
|
Karsten Hopp |
c915e4 |
nfa_state_T state[0]; /* actually longer.. */
|
|
Karsten Hopp |
c915e4 |
} nfa_regprog_T;
|
|
Karsten Hopp |
c915e4 |
*** ../vim-7.3.1023/src/version.c 2013-05-26 15:14:49.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
--- src/version.c 2013-05-26 16:55:29.000000000 +0200
|
|
Karsten Hopp |
c915e4 |
***************
|
|
Karsten Hopp |
c915e4 |
*** 730,731 ****
|
|
Karsten Hopp |
c915e4 |
--- 730,733 ----
|
|
Karsten Hopp |
c915e4 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
c915e4 |
+ /**/
|
|
Karsten Hopp |
c915e4 |
+ 1024,
|
|
Karsten Hopp |
c915e4 |
/**/
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
--
|
|
Karsten Hopp |
c915e4 |
An alien life briefly visits earth. Just before departing it leaves a
|
|
Karsten Hopp |
c915e4 |
message in the dust on the back of a white van. The world is shocked
|
|
Karsten Hopp |
c915e4 |
and wants to know what it means. After months of studies the worlds
|
|
Karsten Hopp |
c915e4 |
best linguistic scientists are able to decipher the message: "Wash me!".
|
|
Karsten Hopp |
c915e4 |
|
|
Karsten Hopp |
c915e4 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
c915e4 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
c915e4 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
c915e4 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|