summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-08-14 11:09:58 -0600
committerKarl Williamson <public@khwilliamson.com>2013-09-24 11:36:13 -0600
commit9991ebf10b0e2a7e04fa47e0b73fdf86b19f7dec (patch)
tree1041c05b6c79979cfe82a717229cf1c5519e374f
parent736d4498bb6fcdcbdbe19d1990bc08319ef4417a (diff)
downloadperl-9991ebf10b0e2a7e04fa47e0b73fdf86b19f7dec.tar.gz
regcomp.c: Extract code into separate function
A future commit will use this functionality from a second place. For now, just cut and paste, and do the minimal ancillary work to get it to compile and pass.
-rw-r--r--embed.fnc7
-rw-r--r--embed.h1
-rw-r--r--proto.h7
-rw-r--r--regcomp.c24
4 files changed, 36 insertions, 3 deletions
diff --git a/embed.fnc b/embed.fnc
index 55e3f3672a..e34af13bc0 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2004,6 +2004,13 @@ Es |regnode*|regbranch |NN struct RExC_state_t *pRExC_state \
|NN I32 *flagp|I32 first|U32 depth
Es |STRLEN |reguni |NN const struct RExC_state_t *pRExC_state \
|UV uv|NN char *s
+Es |void |set_ANYOF_arg |NN struct RExC_state_t* const pRExC_state \
+ |NN regnode* const ret \
+ |NULLOK SV* const cp_list \
+ |NN SV* const listsv \
+ |const STRLEN initial_listsv_len \
+ |NULLOK SV* const swash \
+ |const bool has_user_defined_property
Es |regnode*|regclass |NN struct RExC_state_t *pRExC_state \
|NN I32 *flagp|U32 depth|const bool stop_at_1 \
|bool allow_multi_fold \
diff --git a/embed.h b/embed.h
index 1cd99f2f03..0a7087dc6a 100644
--- a/embed.h
+++ b/embed.h
@@ -948,6 +948,7 @@
#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 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)
diff --git a/proto.h b/proto.h
index 951951898b..6f41f4f0d4 100644
--- a/proto.h
+++ b/proto.h
@@ -6835,6 +6835,13 @@ STATIC void S_scan_commit(pTHX_ const struct RExC_state_t *pRExC_state, struct s
#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)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2)
+ __attribute__nonnull__(pTHX_4);
+#define PERL_ARGS_ASSERT_SET_ANYOF_ARG \
+ assert(pRExC_state); assert(ret); assert(listsv)
+
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)
__attribute__nonnull__(pTHX_2)
diff --git a/regcomp.c b/regcomp.c
index b6bdaf011d..538cf322b0 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -14028,6 +14028,26 @@ parseit:
swash = NULL;
}
+ set_ANYOF_arg(pRExC_state, ret, cp_list,
+ listsv, initial_listsv_len,
+ swash, has_user_defined_property);
+
+ *flagp |= HASWIDTH|SIMPLE;
+ return ret;
+}
+
+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)
+{
+ UV n;
+
+ PERL_ARGS_ASSERT_SET_ANYOF_ARG;
+
if (! cp_list
&& ! HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION)
{
@@ -14072,10 +14092,8 @@ parseit:
RExC_rxi->data->data[n] = (void*)rv;
ARG_SET(ret, n);
}
-
- *flagp |= HASWIDTH|SIMPLE;
- return ret;
}
+
#undef HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION