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

updated for version 7.3.1078

Problem:    New regexp engine: \@! doesn't work.
Solution:   Implement the negated version of \@=.
This commit is contained in:
Bram Moolenaar
2013-05-30 22:44:02 +02:00
parent 35eacd7180
commit b06e20e6ba
4 changed files with 55 additions and 6 deletions

View File

@@ -303,13 +303,20 @@ STARTTEST
:" will never match
:call add(tl, [2, 'abcd\@=e', 'any text in here ... '])
:call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc'])
:" no match
:call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B'])
:call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend'])
:" no match
:call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B'])
:call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob'])
:call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1'])
:call add(tl, [2, 'foo\(bar\)\@!', 'foobar'])
:call add(tl, [2, 'foo\(bar\)\@!', 'foo bar', 'foo'])
:call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if then else'])
:call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if else ', 'if else ', ' '])
:call add(tl, [2, '\(foo\)\@!bar', 'foobar', 'bar'])
:call add(tl, [2, '\(foo\)\@!...bar', 'foobar'])
:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' bar foo '])
:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo bar '])
:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo xxx ', 'foo'])
:"
:"""" Combining different tests and features
:call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])

View File

@@ -678,6 +678,33 @@ OK 2 - .*John\&.*Bob
OK 0 - \v(test1)@=.*yep
OK 1 - \v(test1)@=.*yep
OK 2 - \v(test1)@=.*yep
OK 0 - foo\(bar\)\@!
OK 1 - foo\(bar\)\@!
OK 2 - foo\(bar\)\@!
OK 0 - foo\(bar\)\@!
OK 1 - foo\(bar\)\@!
OK 2 - foo\(bar\)\@!
OK 0 - if \(\(then\)\@!.\)*$
OK 1 - if \(\(then\)\@!.\)*$
OK 2 - if \(\(then\)\@!.\)*$
OK 0 - if \(\(then\)\@!.\)*$
OK 1 - if \(\(then\)\@!.\)*$
OK 2 - if \(\(then\)\@!.\)*$
OK 0 - \(foo\)\@!bar
OK 1 - \(foo\)\@!bar
OK 2 - \(foo\)\@!bar
OK 0 - \(foo\)\@!...bar
OK 1 - \(foo\)\@!...bar
OK 2 - \(foo\)\@!...bar
OK 0 - ^\%(.*bar\)\@!.*\zsfoo
OK 1 - ^\%(.*bar\)\@!.*\zsfoo
OK 2 - ^\%(.*bar\)\@!.*\zsfoo
OK 0 - ^\%(.*bar\)\@!.*\zsfoo
OK 1 - ^\%(.*bar\)\@!.*\zsfoo
OK 2 - ^\%(.*bar\)\@!.*\zsfoo
OK 0 - ^\%(.*bar\)\@!.*\zsfoo
OK 1 - ^\%(.*bar\)\@!.*\zsfoo
OK 2 - ^\%(.*bar\)\@!.*\zsfoo
OK 0 - [[:alpha:]]\{-2,6}
OK 1 - [[:alpha:]]\{-2,6}
OK 2 - [[:alpha:]]\{-2,6}