comparison src/regexp.c @ 308:74e9d19831c2 v7.0081

updated for version 7.0081
author vimboss
date Mon, 06 Jun 2005 21:59:07 +0000
parents 9a1c2a8186b7
children 6c62b9b939bd
comparison
equal deleted inserted replaced
307:7010607c5753 308:74e9d19831c2
320 */ 320 */
321 #define UCHARAT(p) ((int)*(char_u *)(p)) 321 #define UCHARAT(p) ((int)*(char_u *)(p))
322 322
323 /* Used for an error (down from) vim_regcomp(): give the error message, set 323 /* Used for an error (down from) vim_regcomp(): give the error message, set
324 * rc_did_emsg and return NULL */ 324 * rc_did_emsg and return NULL */
325 #define EMSG_RET_NULL(m) { EMSG(m); rc_did_emsg = TRUE; return NULL; } 325 #define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = TRUE, NULL)
326 #define EMSG_M_RET_NULL(m, c) { EMSG2(m, c ? "" : "\\"); rc_did_emsg = TRUE; return NULL; } 326 #define EMSG_M_RET_NULL(m, c) return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = TRUE, NULL)
327 #define EMSG_RET_FAIL(m) { EMSG(m); rc_did_emsg = TRUE; return FAIL; } 327 #define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = TRUE, FAIL)
328 #define EMSG_ONE_RET_NULL EMSG_M_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL) 328 #define EMSG_ONE_RET_NULL EMSG_M_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
329 329
330 #define MAX_LIMIT (32767L << 16L) 330 #define MAX_LIMIT (32767L << 16L)
331 331
332 static int re_multi_type __ARGS((int)); 332 static int re_multi_type __ARGS((int));
1244 /* Check for proper termination. */ 1244 /* Check for proper termination. */
1245 if (paren != REG_NOPAREN && getchr() != Magic(')')) 1245 if (paren != REG_NOPAREN && getchr() != Magic(')'))
1246 { 1246 {
1247 #ifdef FEAT_SYN_HL 1247 #ifdef FEAT_SYN_HL
1248 if (paren == REG_ZPAREN) 1248 if (paren == REG_ZPAREN)
1249 EMSG_RET_NULL(_("E52: Unmatched \\z(")) 1249 EMSG_RET_NULL(_("E52: Unmatched \\z("));
1250 else 1250 else
1251 #endif 1251 #endif
1252 if (paren == REG_NPAREN) 1252 if (paren == REG_NPAREN)
1253 EMSG_M_RET_NULL(_("E53: Unmatched %s%%("), reg_magic == MAGIC_ALL) 1253 EMSG_M_RET_NULL(_("E53: Unmatched %s%%("), reg_magic == MAGIC_ALL);
1254 else 1254 else
1255 EMSG_M_RET_NULL(_("E54: Unmatched %s("), reg_magic == MAGIC_ALL) 1255 EMSG_M_RET_NULL(_("E54: Unmatched %s("), reg_magic == MAGIC_ALL);
1256 } 1256 }
1257 else if (paren == REG_NOPAREN && peekchr() != NUL) 1257 else if (paren == REG_NOPAREN && peekchr() != NUL)
1258 { 1258 {
1259 if (curchr == Magic(')')) 1259 if (curchr == Magic(')'))
1260 EMSG_M_RET_NULL(_("E55: Unmatched %s)"), reg_magic == MAGIC_ALL) 1260 EMSG_M_RET_NULL(_("E55: Unmatched %s)"), reg_magic == MAGIC_ALL);
1261 else 1261 else
1262 EMSG_RET_NULL(_(e_trailing)) /* "Can't happen". */ 1262 EMSG_RET_NULL(_(e_trailing)); /* "Can't happen". */
1263 /* NOTREACHED */ 1263 /* NOTREACHED */
1264 } 1264 }
1265 /* 1265 /*
1266 * Here we set the flag allowing back references to this set of 1266 * Here we set the flag allowing back references to this set of
1267 * parentheses. 1267 * parentheses.
2983 union 2983 union
2984 { 2984 {
2985 char_u *ptr; 2985 char_u *ptr;
2986 lpos_T pos; 2986 lpos_T pos;
2987 } se_u; 2987 } se_u;
2988 int se_len;
2989 } save_se_T; 2988 } save_se_T;
2990 2989
2991 static char_u *reg_getline __ARGS((linenr_T lnum)); 2990 static char_u *reg_getline __ARGS((linenr_T lnum));
2992 static long vim_regexec_both __ARGS((char_u *line, colnr_T col)); 2991 static long vim_regexec_both __ARGS((char_u *line, colnr_T col));
2993 static long regtry __ARGS((regprog_T *prog, colnr_T col)); 2992 static long regtry __ARGS((regprog_T *prog, colnr_T col));