forked from aniani/vim
updated for version 7.3.1055
Problem: Negated collection does not match newline. Solution: Handle newline differently. (Hiroshi Shirosaki)
This commit is contained in:
@@ -1203,13 +1203,6 @@ collection:
|
|||||||
}
|
}
|
||||||
mb_ptr_adv(regparse);
|
mb_ptr_adv(regparse);
|
||||||
|
|
||||||
if (extra == ADD_NL) /* \_[] also matches \n */
|
|
||||||
{
|
|
||||||
EMIT(reg_string ? NL : NFA_NEWL);
|
|
||||||
TRY_NEG();
|
|
||||||
EMIT_GLUE();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* skip the trailing ] */
|
/* skip the trailing ] */
|
||||||
regparse = endp;
|
regparse = endp;
|
||||||
mb_ptr_adv(regparse);
|
mb_ptr_adv(regparse);
|
||||||
@@ -1219,6 +1212,14 @@ collection:
|
|||||||
EMIT(NFA_END_NEG_RANGE);
|
EMIT(NFA_END_NEG_RANGE);
|
||||||
EMIT(NFA_CONCAT);
|
EMIT(NFA_CONCAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* \_[] also matches \n but it's not negated */
|
||||||
|
if (extra == ADD_NL)
|
||||||
|
{
|
||||||
|
EMIT(reg_string ? NL : NFA_NEWL);
|
||||||
|
EMIT(NFA_OR);
|
||||||
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
} /* if exists closing ] */
|
} /* if exists closing ] */
|
||||||
|
|
||||||
|
@@ -344,9 +344,13 @@ STARTTEST
|
|||||||
:call add(tl, [0, '\(<<\)\@1<=span.', 'xxspanxxxx<spanxx<<spanyyy'])
|
:call add(tl, [0, '\(<<\)\@1<=span.', 'xxspanxxxx<spanxx<<spanyyy'])
|
||||||
:call add(tl, [0, '\(<<\)\@2<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<'])
|
:call add(tl, [0, '\(<<\)\@2<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<'])
|
||||||
:"
|
:"
|
||||||
:"""" Run the tests
|
:"""" "\_" prepended negated collection matches EOL
|
||||||
|
:call add(tl, [2, '\_[^8-9]\+', "asfi\n9888", "asfi\n"])
|
||||||
|
:call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"])
|
||||||
:"
|
:"
|
||||||
:"
|
:"
|
||||||
|
:"""" Run the tests
|
||||||
|
:"
|
||||||
:for t in tl
|
:for t in tl
|
||||||
: let re = t[0]
|
: let re = t[0]
|
||||||
: let pat = t[1]
|
: let pat = t[1]
|
||||||
|
@@ -731,6 +731,12 @@ OK 0 - \(<<\)\@1<=span.
|
|||||||
OK 1 - \(<<\)\@1<=span.
|
OK 1 - \(<<\)\@1<=span.
|
||||||
OK 0 - \(<<\)\@2<=span.
|
OK 0 - \(<<\)\@2<=span.
|
||||||
OK 1 - \(<<\)\@2<=span.
|
OK 1 - \(<<\)\@2<=span.
|
||||||
|
OK 0 - \_[^8-9]\+
|
||||||
|
OK 1 - \_[^8-9]\+
|
||||||
|
OK 2 - \_[^8-9]\+
|
||||||
|
OK 0 - \_[^a]\+
|
||||||
|
OK 1 - \_[^a]\+
|
||||||
|
OK 2 - \_[^a]\+
|
||||||
192.168.0.1
|
192.168.0.1
|
||||||
192.168.0.1
|
192.168.0.1
|
||||||
192.168.0.1
|
192.168.0.1
|
||||||
|
@@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1055,
|
||||||
/**/
|
/**/
|
||||||
1054,
|
1054,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user