]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1091 v7.3.1091
authorBram Moolenaar <Bram@vim.org>
Sun, 2 Jun 2013 13:01:57 +0000 (15:01 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 2 Jun 2013 13:01:57 +0000 (15:01 +0200)
Problem:    New regexp engine: no error when using \z1 or \z( where it does
            not work.
Solution:   Give an error message.

src/regexp.c
src/regexp_nfa.c
src/version.c

index 3eaf74dd93b2daac89dcc0d0caa30b2b36a9ded1..2804f8062cc5c1b0d3f98a4686ee27a7eff89937 100644 (file)
@@ -361,6 +361,8 @@ 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(");
 static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)");
+static char_u e_z_not_allowed[] = N_("E66: \\z( not allowed here");
+static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here");
 
 #define NOT_MULTI      0
 #define MULTI_ONE      1
@@ -2120,7 +2122,7 @@ regatom(flagp)
            {
 #ifdef FEAT_SYN_HL
                case '(': if (reg_do_extmatch != REX_SET)
-                             EMSG_RET_NULL(_("E66: \\z( not allowed here"));
+                             EMSG_RET_NULL(_(e_z_not_allowed));
                          if (one_exactly)
                              EMSG_ONE_RET_NULL;
                          ret = reg(REG_ZPAREN, &flags);
@@ -2139,7 +2141,7 @@ regatom(flagp)
                case '7':
                case '8':
                case '9': if (reg_do_extmatch != REX_USE)
-                             EMSG_RET_NULL(_("E67: \\z1 et al. not allowed here"));
+                             EMSG_RET_NULL(_(e_z1_not_allowed));
                          ret = regnode(ZREF + c - '0');
                          re_has_z = REX_USE;
                          break;
index 3699331d672fbecd53c5d1d966ea498b2d1d4b71..f8f207cec3cbfc7fc8233aad6b8e95af4502c71a 100644 (file)
@@ -865,6 +865,8 @@ nfa_regatom()
                case '8':
                case '9':
                    /* \z1...\z9 */
+                   if (reg_do_extmatch != REX_USE)
+                       EMSG_RET_FAIL(_(e_z1_not_allowed));
                    EMIT(NFA_ZREF1 + (no_Magic(c) - '1'));
                    /* No need to set nfa_has_backref, the sub-matches don't
                     * change when \z1 .. \z9 maches or not. */
@@ -872,6 +874,8 @@ nfa_regatom()
                    break;
                case '(':
                    /* \z(  */
+                   if (reg_do_extmatch != REX_SET)
+                       EMSG_RET_FAIL(_(e_z_not_allowed));
                    if (nfa_reg(REG_ZPAREN) == FAIL)
                        return FAIL;        /* cascaded error */
                    re_has_z = REX_SET;
index acb8f97db0606ffa198598bea62b1a29f49afed3..3824278ddc4d3bcdf273f8f76ec0a2162dc2f0f6 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1091,
 /**/
     1090,
 /**/