1
0
forked from aniani/vim

updated for version 7.4.437

Problem:    New and old regexp engine are not consistent.
Solution:   Also give an error for "\ze*" for the old regexp engine.
This commit is contained in:
Bram Moolenaar
2014-09-09 17:18:49 +02:00
parent 371932a775
commit fb03140730
3 changed files with 20 additions and 13 deletions

View File

@@ -358,6 +358,8 @@ static void regdump __ARGS((char_u *, bt_regprog_T *));
static char_u *regprop __ARGS((char_u *));
#endif
static int re_mult_next __ARGS((char *what));
static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
@@ -2166,9 +2168,13 @@ regatom(flagp)
#endif
case 's': ret = regnode(MOPEN + 0);
if (re_mult_next("\\zs") == FAIL)
return NULL;
break;
case 'e': ret = regnode(MCLOSE + 0);
if (re_mult_next("\\ze") == FAIL)
return NULL;
break;
default: EMSG_RET_NULL(_("E68: Invalid character after \\z"));
@@ -7005,6 +7011,18 @@ regprop(op)
}
#endif /* DEBUG */
/*
* Used in a place where no * or \+ can follow.
*/
static int
re_mult_next(what)
char *what;
{
if (re_multi_type(peekchr()) == MULTI_MULT)
EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
return OK;
}
#ifdef FEAT_MBYTE
static void mb_decompose __ARGS((int c, int *c1, int *c2, int *c3));