forked from aniani/vim
updated for version 7.3.1217
Problem: New regexp engine: Can't handle \%[[ao]]. (Yukihiro Nakadaira) Solution: Support nested atoms inside \%[].
This commit is contained in:
@@ -1150,13 +1150,16 @@ nfa_regatom()
|
|||||||
int n;
|
int n;
|
||||||
|
|
||||||
/* \%[abc] */
|
/* \%[abc] */
|
||||||
for (n = 0; (c = getchr()) != ']'; ++n)
|
for (n = 0; (c = peekchr()) != ']'; ++n)
|
||||||
{
|
{
|
||||||
if (c == NUL)
|
if (c == NUL)
|
||||||
EMSG2_RET_FAIL(_(e_missing_sb),
|
EMSG2_RET_FAIL(_(e_missing_sb),
|
||||||
reg_magic == MAGIC_ALL);
|
reg_magic == MAGIC_ALL);
|
||||||
EMIT(c);
|
/* recursive call! */
|
||||||
|
if (nfa_regatom() == FAIL)
|
||||||
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
getchr(); /* get the ] */
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
EMSG2_RET_FAIL(_(e_empty_sb),
|
EMSG2_RET_FAIL(_(e_empty_sb),
|
||||||
reg_magic == MAGIC_ALL);
|
reg_magic == MAGIC_ALL);
|
||||||
|
@@ -366,6 +366,7 @@ STARTTEST
|
|||||||
:call add(tl, [2, '\%[bar]x', 'barxx', 'barx'])
|
:call add(tl, [2, '\%[bar]x', 'barxx', 'barx'])
|
||||||
:call add(tl, [2, '\%[bar]x', 'bxx', 'bx'])
|
:call add(tl, [2, '\%[bar]x', 'bxx', 'bx'])
|
||||||
:call add(tl, [2, '\%[bar]x', 'xxx', 'x'])
|
:call add(tl, [2, '\%[bar]x', 'xxx', 'x'])
|
||||||
|
:call add(tl, [2, 'b\%[[ao]r]', 'bar bor', 'bar'])
|
||||||
:"
|
:"
|
||||||
:"""" Alternatives, must use first longest match
|
:"""" Alternatives, must use first longest match
|
||||||
:call add(tl, [2, 'goo\|go', 'google', 'goo'])
|
:call add(tl, [2, 'goo\|go', 'google', 'goo'])
|
||||||
|
@@ -836,6 +836,9 @@ OK 2 - \%[bar]x
|
|||||||
OK 0 - \%[bar]x
|
OK 0 - \%[bar]x
|
||||||
OK 1 - \%[bar]x
|
OK 1 - \%[bar]x
|
||||||
OK 2 - \%[bar]x
|
OK 2 - \%[bar]x
|
||||||
|
OK 0 - b\%[[ao]r]
|
||||||
|
OK 1 - b\%[[ao]r]
|
||||||
|
OK 2 - b\%[[ao]r]
|
||||||
OK 0 - goo\|go
|
OK 0 - goo\|go
|
||||||
OK 1 - goo\|go
|
OK 1 - goo\|go
|
||||||
OK 2 - goo\|go
|
OK 2 - goo\|go
|
||||||
|
@@ -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 */
|
||||||
|
/**/
|
||||||
|
1217,
|
||||||
/**/
|
/**/
|
||||||
1216,
|
1216,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user