This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move bulk of pp_regcomp() into re_op_compile()
authorDavid Mitchell <davem@iabyn.com>
Fri, 4 Nov 2011 10:12:20 +0000 (10:12 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:25:52 +0000 (13:25 +0100)
commit9f141731d83a1ac6294a5580a5b11ff41490309a
treee71949f74544a981f3b594d10dc601589aa91740
parent867940b89f1d3f001a6df1d888925b9ca246fe96
Move bulk of pp_regcomp() into re_op_compile()

When called, pp_regcomp() is presented with a list of SVs on the stack.
Previously, it would perform (amongst other things):
  * overloading those SVs;
  * concatenating them;
  * detection of bare /$qr/;
  * detection of unchanged pattern;
optionally followed by a call to the built-in or an external regexp
compiler.

Since we want to avoid premature concatenation (so that we can handle
/$runtime(?{...})/), move all these activities from pp_regcomp() into
re_op_compile().

This makes re_op_compile() a bit cumbersome, with a large arg list,
but I haven't found any way of only moving only a subset of the above.

Note that a side-effect of this is that qr-overloading now works for all
regex compilations, not just those reached via pp_regcomp(); in particular
this now invokes the qr method rather than the "" method if available:
/(??{ $overloaded_object })/
embed.fnc
embed.h
lib/overload.t
op.c
pp_ctl.c
proto.h
regcomp.c