vim-patch:7.4.437

Problem:    New and old regexp engine are not consistent.
Solution:   Also give an error for "\ze*" for the old regexp engine.

https://code.google.com/p/vim/source/detail?r=v7-4-437
This commit is contained in:
Scott Prager 2014-10-25 15:34:06 -04:00 committed by Justin M. Keyes
parent 44635add18
commit ca7c509ae0
3 changed files with 16 additions and 10 deletions

View File

@ -1983,9 +1983,15 @@ static char_u *regatom(int *flagp)
break; break;
case 's': ret = regnode(MOPEN + 0); case 's': ret = regnode(MOPEN + 0);
if (!re_mult_next("\\zs")) {
return NULL;
}
break; break;
case 'e': ret = regnode(MCLOSE + 0); case 'e': ret = regnode(MCLOSE + 0);
if (!re_mult_next("\\ze")) {
return NULL;
}
break; break;
default: EMSG_RET_NULL(_("E68: Invalid character after \\z")); default: EMSG_RET_NULL(_("E68: Invalid character after \\z"));
@ -2460,6 +2466,15 @@ do_multibyte:
return ret; return ret;
} }
/// Used in a place where no * or \+ can follow.
static bool re_mult_next(char *what)
{
if (re_multi_type(peekchr()) == MULTI_MULT) {
EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
}
return true;
}
/* /*
* Return TRUE if MULTIBYTECODE should be used instead of EXACTLY for * Return TRUE if MULTIBYTECODE should be used instead of EXACTLY for
* character "c". * character "c".

View File

@ -1747,15 +1747,6 @@ nfa_do_multibyte:
return OK; return OK;
} }
/// Used in a place where no * or \+ can follow.
static bool re_mult_next(char *what)
{
if (re_multi_type(peekchr()) == MULTI_MULT) {
EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
}
return true;
}
/* /*
* Parse something followed by possible [*+=]. * Parse something followed by possible [*+=].
* *

View File

@ -228,7 +228,7 @@ static int included_patches[] = {
440, 440,
439, 439,
//438, //438,
//437, 437,
436, 436,
//435, //435,
//434, //434,