PL_regoffs = re->offs; /* essentially NOOP on GOSUB */
- *PL_reglastparen = 0;
- *PL_reglastcloseparen = 0;
+ /* see regtry, specifically PL_reglast(?:close)?paren is a pointer! (i dont know why) :dmq */
+ PL_reglastparen = &re->lastparen;
+ PL_reglastcloseparen = &re->lastcloseparen;
+ re->lastparen = 0;
+ re->lastcloseparen = 0;
+
PL_reginput = locinput;
PL_regsize = 0;
regcpblow(ST.cp);
cur_eval = ST.prev_eval;
cur_curlyx = ST.prev_curlyx;
+
+ PL_reglastparen = &rex->lastparen;
+ PL_reglastcloseparen = &rex->lastcloseparen;
+
/* XXXX This is too dramatic a measure... */
PL_reg_maxiter = 0;
if ( nochange_depth )
SETREX(rex_sv,ST.prev_rex);
rex = (struct regexp *)SvANY(rex_sv);
rexi = RXi_GET(rex);
+ PL_reglastparen = &rex->lastparen;
+ PL_reglastcloseparen = &rex->lastcloseparen;
+
PL_reginput = locinput;
REGCP_UNWIND(ST.lastcp);
regcppop(rex);
s/(*:X)A+|(*:Y)B+|(*:Z)C+/$REGMARK/g;
iseq $_, "ZYX";
}
+{
+ our @ctl_n=();
+ our @plus=();
+ our $nested_tags;
+ $nested_tags = qr{
+ <
+ (\w+)
+ (?{
+ push @ctl_n,$^N;
+ push @plus,$+;
+ })
+ >
+ (??{$nested_tags})*
+ </\s* \w+ \s*>
+ }x;
+
+ my $match= '<bla><blubb></blubb></bla>' =~ m/^$nested_tags$/;
+ ok($match,'nested construct matches');
+ iseq("@ctl_n","bla blubb",'$^N inside of (?{}) works as expected');
+ iseq("@plus","bla blubb",'$+ inside of (?{}) works as expected');
+}
+
+
+
+
# Test counter is at bottom of file. Put new tests above here.
#-------------------------------------------------------------------
# Keep the following tests last -- they may crash perl
iseq(0+$::test,$::TestCount,"Got the right number of tests!");
# Don't forget to update this!
BEGIN {
- $::TestCount = 4016;
+ $::TestCount = 4019;
print "1..$::TestCount\n";
}