STATIC CHECKPOINT
S_regcppush(pTHX_ const regexp *rex, I32 parenfloor, U32 maxopenparen)
{
- dVAR;
const int retval = PL_savestack_ix;
const int paren_elems_to_push =
(maxopenparen - parenfloor) * REGCP_PAREN_ELEMS;
STATIC void
S_regcppop(pTHX_ regexp *rex, U32 *maxopenparen_p)
{
- dVAR;
UV i;
U32 paren;
GET_RE_DEBUG_FLAGS_DECL;
Perl_croak(aTHX_ "panic: isFOO_lc() has an unexpected character class '%d'", classnum);
}
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
return FALSE;
}
below 256 */
}
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
return FALSE;
}
const U32 flags,
re_scream_pos_data *data)
{
- dVAR;
struct regexp *const prog = ReANY(rx);
SSize_t start_shift = prog->check_offset_min;
/* Should be nonnegative! */
} \
} STMT_END
-#define REXEC_FBC_EXACTISH_SCAN(CoNd) \
+#define REXEC_FBC_EXACTISH_SCAN(COND) \
STMT_START { \
while (s <= e) { \
- if ( (CoNd) \
+ if ( (COND) \
&& (ln == 1 || folder(s, pat_string, ln)) \
&& (reginfo->intuit || regtry(reginfo, &s)) )\
goto got_it; \
} \
} STMT_END
-#define REXEC_FBC_UTF8_SCAN(CoDe) \
+#define REXEC_FBC_UTF8_SCAN(CODE) \
STMT_START { \
while (s < strend) { \
- CoDe \
+ CODE \
s += UTF8SKIP(s); \
} \
} STMT_END
-#define REXEC_FBC_SCAN(CoDe) \
+#define REXEC_FBC_SCAN(CODE) \
STMT_START { \
while (s < strend) { \
- CoDe \
+ CODE \
s++; \
} \
} STMT_END
-#define REXEC_FBC_UTF8_CLASS_SCAN(CoNd) \
+#define REXEC_FBC_UTF8_CLASS_SCAN(COND) \
REXEC_FBC_UTF8_SCAN( \
- if (CoNd) { \
+ if (COND) { \
if (tmp && (reginfo->intuit || regtry(reginfo, &s))) \
goto got_it; \
else \
tmp = 1; \
)
-#define REXEC_FBC_CLASS_SCAN(CoNd) \
+#define REXEC_FBC_CLASS_SCAN(COND) \
REXEC_FBC_SCAN( \
- if (CoNd) { \
+ if (COND) { \
if (tmp && (reginfo->intuit || regtry(reginfo, &s))) \
goto got_it; \
else \
if ((reginfo->intuit || regtry(reginfo, &s))) \
goto got_it
-#define REXEC_FBC_CSCAN(CoNdUtF8,CoNd) \
+#define REXEC_FBC_CSCAN(CONDUTF8,COND) \
if (utf8_target) { \
- REXEC_FBC_UTF8_CLASS_SCAN(CoNdUtF8); \
+ REXEC_FBC_UTF8_CLASS_SCAN(CONDUTF8); \
} \
else { \
- REXEC_FBC_CLASS_SCAN(CoNd); \
+ REXEC_FBC_CLASS_SCAN(COND); \
}
#define DUMP_EXEC_POS(li,s,doutf8) \
} \
); \
-#define UTF8_LOAD(TeSt1_UtF8, TeSt2_UtF8, IF_SUCCESS, IF_FAIL) \
+#define UTF8_LOAD(TEST1_UTF8, TEST2_UTF8, IF_SUCCESS, IF_FAIL) \
if (s == reginfo->strbeg) { \
tmp = '\n'; \
} \
tmp = utf8n_to_uvchr(r, (U8*) reginfo->strend - r, \
0, UTF8_ALLOW_DEFAULT); \
} \
- tmp = TeSt1_UtF8; \
+ tmp = TEST1_UTF8; \
LOAD_UTF8_CHARCLASS_ALNUM(); \
REXEC_FBC_UTF8_SCAN( \
- if (tmp == ! (TeSt2_UtF8)) { \
+ if (tmp == ! (TEST2_UTF8)) { \
tmp = !tmp; \
IF_SUCCESS; \
} \
default:
Perl_croak(aTHX_ "panic: find_byclass() node %d='%s' has an unexpected character class '%d'", OP(c), PL_reg_name[OP(c)], classnum);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
}
break;
/* flags: For optimizations. See REXEC_* in regexp.h */
{
- dVAR;
struct regexp *const prog = ReANY(rx);
char *s;
regnode *c;
STATIC I32 /* 0 failure, 1 success */
S_regtry(pTHX_ regmatch_info *reginfo, char **startposp)
{
- dVAR;
CHECKPOINT lastcp;
REGEXP *const rx = reginfo->prog;
regexp *const prog = ReANY(rx);
default:
Perl_croak(aTHX_ "panic: Unexpected op %u", OP(text_node));
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
}
}
REPORT_CODE_OFF+depth*2, "", PL_colors[4], PL_colors[5])
);
sayNO_SILENT;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
/* FALLTHROUGH */
case TRIE: /* (ab|cd) */
);
goto trie_first_try; /* jump into the fail handler */
}}
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case TRIE_next_fail: /* we failed - try next alternative */
{
if (ST.accepted > 1 || has_cutgroup) {
PUSH_STATE_GOTO(TRIE_next, scan, (char*)uc);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
/* only one choice left - just continue */
DEBUG_EXECUTE_r({
locinput = (char*)uc;
continue; /* execute rest of RE */
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
#undef ST
/* and then jump to the code we share with EVAL */
goto eval_recurse_doit;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case EVAL: /* /(?{A})B/ /(??{A})B/ and /(?(?{A})X|Y)B/ */
if (cur_eval && cur_eval->locinput==locinput) {
cur_eval = st;
/* now continue from first node in postoned RE */
PUSH_YES_STATE_GOTO(EVAL_AB, startpoint, locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
case EVAL_AB: /* cleanup after a successful (??{A})B */
ST.lastloc = NULL; /* this will be updated by WHILEM */
PUSH_YES_STATE_GOTO(CURLYX_end, PREVOPER(next), locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
case CURLYX_end: /* just finished matching all of A*B */
cur_curlyx = ST.prev_curlyx;
sayYES;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case CURLYX_end_fail: /* just failed to match all of A*B */
regcpblow(ST.cp);
cur_curlyx = ST.prev_curlyx;
sayNO;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
#undef ST
REGCP_SET(ST.lastcp);
PUSH_STATE_GOTO(WHILEM_A_pre, A, locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
/* If degenerate A matches "", assume A done. */
REGCP_SET(ST.lastcp);
PUSH_YES_STATE_GOTO(WHILEM_B_min, ST.save_curlyx->u.curlyx.B,
locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
/* Prefer A over B for maximal matching. */
cur_curlyx->u.curlyx.lastloc = locinput;
REGCP_SET(ST.lastcp);
PUSH_STATE_GOTO(WHILEM_A_max, A, locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
goto do_whilem_B_max;
}
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case WHILEM_B_min: /* just matched B in a minimal match */
case WHILEM_B_max: /* just matched B in a maximal match */
cur_curlyx = ST.save_curlyx;
sayYES;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case WHILEM_B_max_fail: /* just failed to match B in a maximal match */
cur_curlyx = ST.save_curlyx;
cur_curlyx->u.curlyx.lastloc = ST.save_lastloc;
cur_curlyx->u.curlyx.count--;
CACHEsayNO;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case WHILEM_A_min_fail: /* just failed to match A in a minimal match */
/* FALLTHROUGH */
cur_curlyx->u.curlyx.lastloc = ST.save_lastloc;
cur_curlyx->u.curlyx.count--;
CACHEsayNO;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case WHILEM_A_max_fail: /* just failed to match A in a maximal match */
REGCP_UNWIND(ST.lastcp);
cur_curlyx = cur_curlyx->u.curlyx.prev_curlyx;
PUSH_YES_STATE_GOTO(WHILEM_B_max, ST.save_curlyx->u.curlyx.B,
locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case WHILEM_B_min_fail: /* just failed to match B in a minimal match */
cur_curlyx = ST.save_curlyx;
PUSH_STATE_GOTO(WHILEM_A_min,
/*A*/ NEXTOPER(ST.save_curlyx->u.curlyx.me) + EXTRA_STEP_2ARGS,
locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
#undef ST
#define ST st->u.branch
} else {
PUSH_STATE_GOTO(BRANCH_next, scan, locinput);
}
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case CUTGROUP: /* /(*THEN)/ */
sv_yes_mark = st->u.mark.mark_name = scan->flags ? NULL :
MUTABLE_SV(rexi->data->data[ ARG( scan ) ]);
PUSH_STATE_GOTO(CUTGROUP_next, next, locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case CUTGROUP_next_fail:
do_cutgroup = 1;
if (st->u.mark.mark_name)
sv_commit = st->u.mark.mark_name;
sayNO;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case BRANCH_next:
sayYES;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case BRANCH_next_fail: /* that branch failed; try the next, if any */
if (do_cutgroup) {
sayNO_SILENT;
}
continue; /* execute next BRANCH[J] op */
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case MINMOD: /* next op will be non-greedy, e.g. A*? */
minmod = 1;
curlym_do_A: /* execute the A in /A{m,n}B/ */
PUSH_YES_STATE_GOTO(CURLYM_A, ST.A, locinput); /* match A */
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case CURLYM_A: /* we've just matched an A */
ST.count++;
}
PUSH_STATE_GOTO(CURLYM_B, ST.B, locinput); /* match B */
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case CURLYM_B_fail: /* just failed to match a B */
REGCP_UNWIND(ST.cp);
REGCP_SET(ST.cp);
goto curly_try_B_max;
}
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case CURLY_B_min_known_fail:
}
PUSH_STATE_GOTO(CURLY_B_min_known, ST.B, locinput);
}
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case CURLY_B_min_fail:
}
}
sayNO;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
curly_try_B_max:
if (ST.c1 == CHRTEST_VOID || could_match) {
CURLY_SETPAREN(ST.paren, ST.count);
PUSH_STATE_GOTO(CURLY_B_max, ST.B, locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
}
/* FALLTHROUGH */
/* execute body of (?...A) */
PUSH_YES_STATE_GOTO(IFMATCH_A, NEXTOPER(NEXTOPER(scan)), newstart);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
case IFMATCH_A_fail: /* body of (?...A) failed */
if (!scan->flags)
sv_yes_mark = sv_commit = MUTABLE_SV(rexi->data->data[ ARG( scan ) ]);
PUSH_STATE_GOTO(COMMIT_next, next, locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case COMMIT_next_fail:
no_final = 1;
case OPFAIL: /* (*FAIL) */
sayNO;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
#define ST st->u.mark
case MARKPOINT: /* (*MARK:foo) */
mark_state = st;
ST.mark_loc = locinput;
PUSH_YES_STATE_GOTO(MARKPOINT_next, next, locinput);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case MARKPOINT_next:
mark_state = ST.prev_mark;
sayYES;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case MARKPOINT_next_fail:
if (popmark && sv_eq(ST.mark_name,popmark))
sv_yes_mark = mark_state ?
mark_state->u.mark.mark_name : NULL;
sayNO;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
case SKIP: /* (*SKIP) */
if (scan->flags) {
}
no_final = 1;
sayNO;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
#undef ST
case LNBREAK: /* \R */
/* switch break jumps here */
scan = next; /* prepare to execute the next op and ... */
continue; /* ... jump back to the top, reusing st */
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
push_yes_state:
/* push a state that backtracks on success */
locinput = pushinput;
st = newst;
continue;
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
}
S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
regmatch_info *const reginfo, I32 max, int depth)
{
- dVAR;
char *scan; /* Pointer to current position in target string */
I32 c;
char *loceol = reginfo->strend; /* local version */
default:
Perl_croak(aTHX_ "panic: regrepeat() called with unrecognized node type %d='%s'", OP(p), PL_reg_name[OP(p)]);
- /* NOTREACHED */
- assert(0);
+ assert(0); /* NOTREACHED */
}
* swash are returned (in a printable form).
* Tied intimately to how regcomp.c sets up the data structure */
- dVAR;
SV *sw = NULL;
SV *si = NULL; /* Input swash initialization string */
SV* invlist = NULL;
* 'off' >= 0, backwards if negative. But don't go outside of position
* 'lim', which better be < s if off < 0 */
- dVAR;
-
PERL_ARGS_ASSERT_REGHOP3;
if (off >= 0) {
STATIC U8 *
S_reghop4(U8 *s, SSize_t off, const U8* llim, const U8* rlim)
{
- dVAR;
-
PERL_ARGS_ASSERT_REGHOP4;
if (off >= 0) {
STATIC U8 *
S_reghopmaybe3(U8* s, SSize_t off, const U8* lim)
{
- dVAR;
-
PERL_ARGS_ASSERT_REGHOPMAYBE3;
if (off >= 0) {
static void
S_cleanup_regmatch_info_aux(pTHX_ void *arg)
{
- dVAR;
regmatch_info_aux *aux = (regmatch_info_aux *) arg;
regmatch_info_aux_eval *eval_state = aux->info_aux_eval;
regmatch_slab *s;
/* Converts substr fields in prog from UTF-8 to bytes, calling fbm_compile
* on the converted value; returns FALSE if can't be converted. */
- dVAR;
int i = 1;
PERL_ARGS_ASSERT_TO_BYTE_SUBSTR;