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 /pod/perlreapi.pod | |
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 'pod/perlreapi.pod')
-rw-r--r-- | pod/perlreapi.pod | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pod/perlreapi.pod b/pod/perlreapi.pod index 5e45620868..93da14b2b8 100644 --- a/pod/perlreapi.pod +++ b/pod/perlreapi.pod @@ -34,6 +34,8 @@ following format: #ifdef USE_ITHREADS void* (*dupe) (pTHX_ REGEXP * const rx, CLONE_PARAMS *param); #endif + REGEXP* (*op_comp) (...); + When a regexp is compiled, its C<engine> field is then set to point at the appropriate structure, so that when it needs to be used Perl can find @@ -462,6 +464,11 @@ modify the final structure if it really must. On unthreaded builds this field doesn't exist. +=head2 op_comp + +This is private to the perl core and subject to change. Should be left +null. + =head1 The REGEXP structure The REGEXP struct is defined in F<regexp.h>. All regex engines must be able to |