This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Recursive formats and closures in formats.
authorFather Chrysostomos <sprout@cpan.org>
Sun, 5 Aug 2012 08:05:45 +0000 (01:05 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 5 Aug 2012 23:02:01 +0000 (16:02 -0700)
commitf32c7e864b6210c7dabe6a78f842c37aa73c56c3
treeb6a222fda29c83ac85ef9cdd7a423c31907b3578
parentbb02a38febc60a289c616282d720015be97842a4
Recursive formats and closures in formats.

Formats called recursively were using the same set of lexicals, so the
inner call would stomp on the outer calls vars, usually clearing them
when exiting.

Previous commits prepared a CvDEPTH field for formats.  This commit
sets it in P(USH|OP)FORMAT and pushes a new pad in enterwrite.

This also allows closures to work properly in formats.  Formerly they
caused assertion failures in cv_clone.  Now cv_clone’s assumptions
about CvDEPTH on CvOUTSIDE and find_runcv are met when subs are embed-
ded in formats.
cop.h
pp_sys.c
t/comp/form_scope.t