0
0
mirror of https://github.com/vim/vim.git synced 2025-11-15 23:14:06 -05:00

updated for version 7.4.036

Problem:    NFA engine does not capture group correctly when using \@>. (ZyX)
Solution:   Copy submatches before doing the recursive match.
This commit is contained in:
Bram Moolenaar
2013-09-25 16:41:54 +02:00
parent 18441ae2cd
commit 699c12076d
4 changed files with 33 additions and 17 deletions

View File

@@ -430,6 +430,7 @@ STARTTEST
:call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
:call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
:call add(tl, [2, '^\(.\{-}b\)\@>.', ' abcbd', ' abc', ' ab'])
:call add(tl, [2, '\(.\{-}\)\(\)\@>$', 'abc', 'abc', 'abc', ''])
:" TODO: BT engine does not restore submatch after failure
:call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa'])
:"

View File

@@ -992,6 +992,9 @@ OK 2 - \(a*\)\@>b
OK 0 - ^\(.\{-}b\)\@>.
OK 1 - ^\(.\{-}b\)\@>.
OK 2 - ^\(.\{-}b\)\@>.
OK 0 - \(.\{-}\)\(\)\@>$
OK 1 - \(.\{-}\)\(\)\@>$
OK 2 - \(.\{-}\)\(\)\@>$
OK 0 - \(a*\)\@>a\|a\+
OK 2 - \(a*\)\@>a\|a\+
OK 0 - \_[^8-9]\+