#define reguni(a,b,c) S_reguni(aTHX_ a,b,c)
#define regwhite S_regwhite
#define scan_commit(a,b,c,d) S_scan_commit(aTHX_ a,b,c,d)
-#define set_ANYOF_arg(a,b,c,d,e,f,g) S_set_ANYOF_arg(aTHX_ a,b,c,d,e,f,g)
+#define set_ANYOF_arg(a,b,c,d,e,f) S_set_ANYOF_arg(aTHX_ a,b,c,d,e,f)
#define study_chunk(a,b,c,d,e,f,g,h,i,j,k) S_study_chunk(aTHX_ a,b,c,d,e,f,g,h,i,j,k)
# endif
# if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C)
#define PERL_ARGS_ASSERT_SCAN_COMMIT \
assert(pRExC_state); assert(data); assert(minlenp)
-STATIC void S_set_ANYOF_arg(pTHX_ struct RExC_state_t* const pRExC_state, regnode* const ret, SV* const cp_list, SV* const listsv, const STRLEN initial_listsv_len, SV* const swash, const bool has_user_defined_property)
+STATIC void S_set_ANYOF_arg(pTHX_ struct RExC_state_t* const pRExC_state, regnode* const node, SV* const cp_list, SV* const runtime_defns, SV* const swash, const bool has_user_defined_property)
__attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_2)
- __attribute__nonnull__(pTHX_4);
+ __attribute__nonnull__(pTHX_2);
#define PERL_ARGS_ASSERT_SET_ANYOF_ARG \
- assert(pRExC_state); assert(ret); assert(listsv)
+ assert(pRExC_state); assert(node)
STATIC SSize_t S_study_chunk(pTHX_ struct RExC_state_t *pRExC_state, regnode **scanp, SSize_t *minlenp, SSize_t *deltap, regnode *last, struct scan_data_t *data, I32 stopparen, U8* recursed, regnode_ssc *and_withp, U32 flags, U32 depth)
__attribute__nonnull__(pTHX_1)
}
set_ANYOF_arg(pRExC_state, ret, cp_list,
- listsv, initial_listsv_len,
+ (HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION)
+ ? listsv : NULL,
swash, has_user_defined_property);
*flagp |= HASWIDTH|SIMPLE;
return ret;
}
+#undef HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION
+
STATIC void
S_set_ANYOF_arg(pTHX_ struct RExC_state_t* const pRExC_state,
- regnode* const ret,
+ regnode* const node,
SV* const cp_list,
- SV* const listsv, const STRLEN initial_listsv_len,
+ SV* const runtime_defns,
SV* const swash,
const bool has_user_defined_property)
{
+ /* Sets the arg field of an ANYOF-type node 'node', using information about
+ * the node passed-in. If there is nothing outside the node's bitmap, the
+ * arg is set to ANYOF_NONBITMAP_EMPTY. Otherwise, it sets the argument to
+ * the count returned by add_data(), having allocated and stored an array,
+ * av, that that count references, as follows:
+ * av[0] stores the character class description in its textual form.
+ * This is used later (regexec.c:Perl_regclass_swash()) to
+ * initialize the appropriate swash, and is also useful for dumping
+ * the regnode. This is set to &PL_sv_undef if the textual
+ * description is not needed at run-time (as happens if the other
+ * elements completely define the class)
+ * av[1] if &PL_sv_undef, is a placeholder to later contain the swash
+ * computed from av[0]. But if no further computation need be done,
+ * the swash is stored there now (and av[0] is &PL_sv_undef).
+ * av[2] stores the cp_list inversion list for use in addition or instead
+ * of av[0]; used only if cp_list exists and av[1] is &PL_sv_undef.
+ * (Otherwise everything needed is already in av[0] and av[1])
+ * av[3] is set if any component of the class is from a user-defined
+ * property; used only if av[2] exists */
+
UV n;
PERL_ARGS_ASSERT_SET_ANYOF_ARG;
- if (! cp_list
- && ! HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION)
- {
- ARG_SET(ret, ANYOF_NONBITMAP_EMPTY);
+ if (! cp_list && ! runtime_defns) {
+ ARG_SET(node, ANYOF_NONBITMAP_EMPTY);
}
else {
- /* av[0] stores the character class description in its textual form.
- * This is used later (regexec.c:Perl_regclass_swash()) to
- * initialize the appropriate swash, and is also useful for
- * dumping the regnode. This is set to &PL_sv_undef if the
- * textual description is not needed at run-time (as happens if
- * the other elements completely define the class)
- * av[1] if &PL_sv_undef, is a placeholder to later contain the swash
- * computed from av[0]. But if no further computation need be
- * done, the swash is stored there now (and av[0] is
- * &PL_sv_undef).
- * av[2] stores the cp_list inversion list for use in addition or
- * instead of av[0]; used only if cp_list exists and av[1] is
- * &PL_sv_undef. (Otherwise everything needed is already in
- * av[0] and av[1])
- * av[3] is set if any component of the class is from a user-defined
- * property; used only if av[2] exists */
AV * const av = newAV();
SV *rv;
- av_store(av, 0, (HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION)
- ? SvREFCNT_inc(listsv) : &PL_sv_undef);
+ av_store(av, 0, (runtime_defns)
+ ? SvREFCNT_inc(runtime_defns) : &PL_sv_undef);
if (swash) {
av_store(av, 1, swash);
SvREFCNT_dec_NN(cp_list);
rv = newRV_noinc(MUTABLE_SV(av));
n = add_data(pRExC_state, 1, "s");
RExC_rxi->data->data[n] = (void*)rv;
- ARG_SET(ret, n);
+ ARG_SET(node, n);
}
}
-#undef HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION
-
/* reg_skipcomment()