diff options
author | David Mitchell <davem@iabyn.com> | 2011-12-13 12:00:12 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-06-13 13:32:47 +0100 |
commit | 3c13cae629d936c43bca9d992cc445d93287af8e (patch) | |
tree | 9263b480e25f43e75b0f9a6cfb160579e3588571 /ext | |
parent | 3b16d10d72cd916e1907c4161cc52322040c227a (diff) | |
download | perl-3c13cae629d936c43bca9d992cc445d93287af8e.tar.gz |
add op_comp field to regexp_engine API
Perl's internal function for compiling regexes that knows about code
blocks, Perl_re_op_compile, isn't part of the engine API. However, the
way that regcomp.c is dual-lifed as ext/re/re_comp.c with debugging
compiled in, means that Perl_re_op_compile is also compiled as
my_re_op_compile. These days days the mechanism to choose whether to call
the main functions or the debugging my_* functions when 'use re debug' is
in scope, is the re engine API jump table. Ergo, to ensure that
my_re_op_compile gets called appropriately, this method needs adding to
the jump table.
So, I've added it, but documented as 'for perl internal use only, set to
null in your engine'.
I've also updated current_re_engine() to always return a pointer to a jump
table, even if we're using the internal engine (formerly it returned
null). This then allows us to use the simple condition (eng->op_comp)
to determine whether the current engine supports code blocks.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/re/re.xs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/re/re.xs b/ext/re/re.xs index 54e3640801..68a5ebc0c2 100644 --- a/ext/re/re.xs +++ b/ext/re/re.xs @@ -12,7 +12,10 @@ START_EXTERN_C extern REGEXP* my_re_compile (pTHX_ SV * const pattern, const U32 pm_flags); -extern REGEXP* my_re_op_compile (pTHX_ SV * const pattern, OP *expr, const U32 pm_flags); +extern REGEXP* my_re_op_compile (pTHX_ SV ** const patternp, int pat_count, + OP *expr, const regexp_engine* eng, REGEXP *VOL old_re, + int *is_bare_re, U32 orig_rx_flags, U32 pm_flags); + extern I32 my_regexec (pTHX_ REGEXP * const prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, void* data, U32 flags); @@ -58,8 +61,9 @@ const struct regexp_engine my_reg_engine = { my_reg_named_buff_iter, my_reg_qr_package, #if defined(USE_ITHREADS) - my_regdupe + my_regdupe, #endif + my_re_op_compile, }; MODULE = re PACKAGE = re |