0
0
mirror of https://github.com/vim/vim.git synced 2025-11-13 22:54:27 -05:00

updated for version 7.4.020

Problem:    NFA engine matches too much with \@>. (John McGowan)
Solution:   When a whole pattern match is found stop searching.
This commit is contained in:
Bram Moolenaar
2013-09-05 16:05:36 +02:00
parent 00b764aa41
commit 78c93e4b6a
4 changed files with 10 additions and 1 deletions

View File

@@ -427,6 +427,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'])
:" TODO: BT engine does not restore submatch after failure
:call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa'])
:"

View File

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