comparison src/regexp.c @ 4688:371cc0c44097 v7.3.1091

updated for version 7.3.1091 Problem: New regexp engine: no error when using \z1 or \z( where it does not work. Solution: Give an error message.
author Bram Moolenaar <bram@vim.org>
date Sun, 02 Jun 2013 15:01:57 +0200
parents 2f51ee8825db
children bd6bef0bd0fb
comparison
equal deleted inserted replaced
4687:79797c8534b5 4688:371cc0c44097
359 359
360 static char_u e_missingbracket[] = N_("E769: Missing ] after %s["); 360 static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
361 static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%("); 361 static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
362 static char_u e_unmatchedp[] = N_("E54: Unmatched %s("); 362 static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
363 static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)"); 363 static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)");
364 static char_u e_z_not_allowed[] = N_("E66: \\z( not allowed here");
365 static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here");
364 366
365 #define NOT_MULTI 0 367 #define NOT_MULTI 0
366 #define MULTI_ONE 1 368 #define MULTI_ONE 1
367 #define MULTI_MULT 2 369 #define MULTI_MULT 2
368 /* 370 /*
2118 c = no_Magic(getchr()); 2120 c = no_Magic(getchr());
2119 switch (c) 2121 switch (c)
2120 { 2122 {
2121 #ifdef FEAT_SYN_HL 2123 #ifdef FEAT_SYN_HL
2122 case '(': if (reg_do_extmatch != REX_SET) 2124 case '(': if (reg_do_extmatch != REX_SET)
2123 EMSG_RET_NULL(_("E66: \\z( not allowed here")); 2125 EMSG_RET_NULL(_(e_z_not_allowed));
2124 if (one_exactly) 2126 if (one_exactly)
2125 EMSG_ONE_RET_NULL; 2127 EMSG_ONE_RET_NULL;
2126 ret = reg(REG_ZPAREN, &flags); 2128 ret = reg(REG_ZPAREN, &flags);
2127 if (ret == NULL) 2129 if (ret == NULL)
2128 return NULL; 2130 return NULL;
2137 case '5': 2139 case '5':
2138 case '6': 2140 case '6':
2139 case '7': 2141 case '7':
2140 case '8': 2142 case '8':
2141 case '9': if (reg_do_extmatch != REX_USE) 2143 case '9': if (reg_do_extmatch != REX_USE)
2142 EMSG_RET_NULL(_("E67: \\z1 et al. not allowed here")); 2144 EMSG_RET_NULL(_(e_z1_not_allowed));
2143 ret = regnode(ZREF + c - '0'); 2145 ret = regnode(ZREF + c - '0');
2144 re_has_z = REX_USE; 2146 re_has_z = REX_USE;
2145 break; 2147 break;
2146 #endif 2148 #endif
2147 2149