B-DeparseTree
view release on metacpan or search on metacpan
lib/B/DeparseTree/P526c.pm view on Meta::CPAN
SIGNATURE_arg_default_none
SIGNATURE_arg_default_op
SIGNATURE_arg_default_padsv
SIGNATURE_arg_default_undef
SIGNATURE_array
SIGNATURE_end
SIGNATURE_hash
SIGNATURE_padintro
SIGNATURE_reload
SVf_FAKE SVs_RMG
SVf_ROK SVpad_OUR
SVpad_TYPED
SVs_SMG
class
main_cv
main_root
main_start
opnumber
perlstring
svref_2object
);
use B::DeparseTree::PPfns;
use B::DeparseTree::SyntaxTree;
use B::DeparseTree::PP;
use B::Deparse;
# Copy unchanged functions from B::Deparse
*begin_is_use = *B::Deparse::begin_is_use;
*const_sv = *B::Deparse::const_sv;
*escape_re = *B::Deparse::escape_re;
*find_scope_st = *B::Deparse::find_scope_st;
*gv_name = *B::Deparse::gv_name;
*keyword = *B::Deparse::keyword;
*meth_pad_subs = *B::Deparse::pad_subs;
*meth_rclass_sv = *B::Deparse::meth_rclass_sv;
*meth_sv = *B::Deparse::meth_sv;
*padany = *B::Deparse::padany;
*padname = *B::Deparse::padname;
*padname_sv = *B::Deparse::padname_sv;
*padval = *B::Deparse::padval;
*populate_curcvlex = *B::Deparse::populate_curcvlex;
*re_flags = *B::Deparse::re_flags;
*rv2gv_or_string = *B::Deparse::rv2gv_or_string;
*stash_variable = *B::Deparse::stash_variable;
*stash_variable_name = *B::Deparse::stash_variable_name;
*tr_chr = *B::Deparse::tr_chr;
use strict;
use vars qw/$AUTOLOAD @ISA @EXPORT/;
use warnings ();
require feature;
use types;
our $VERSION = '3.2.0';
our @ISA = qw(Exporter);
BEGIN {
# List version-specific constants here.
# Easiest way to keep this code portable between version looks to
# be to fake up a dummy constant that will never actually be true.
foreach (qw(OPpSORT_INPLACE OPpSORT_DESCEND OPpITER_REVERSED OPpCONST_NOVER
OPpPAD_STATE PMf_SKIPWHITE RXf_SKIPWHITE
PMf_CHARSET PMf_KEEPCOPY PMf_NOCAPTURE CVf_ANONCONST
CVf_LOCKED OPpREVERSE_INPLACE OPpSUBSTR_REPL_FIRST
PMf_NONDESTRUCT OPpCONST_ARYBASE OPpEVAL_BYTES
OPpLVREF_TYPE OPpLVREF_SV OPpLVREF_AV OPpLVREF_HV
OPpLVREF_CV OPpLVREF_ELEM SVpad_STATE)) {
eval { B->import($_) };
no strict 'refs';
*{$_} = sub () {0} unless *{$_}{CODE};
}
}
BEGIN { for (qw[ rv2sv aelem
rv2av rv2hv helem custom ]) {
eval "sub OP_\U$_ () { " . opnumber($_) . "}"
}}
# The following OPs don't have functions:
# pp_padany -- does not exist after parsing
sub AUTOLOAD {
if ($AUTOLOAD =~ s/^.*::pp_//) {
warn "unexpected OP_".
($_[1]->type == OP_CUSTOM ? "CUSTOM ($AUTOLOAD)" : uc $AUTOLOAD);
return "XXX";
} else {
Carp::confess "Undefined subroutine $AUTOLOAD called";
}
}
sub DESTROY {} # Do not AUTOLOAD
# The BEGIN {} is used here because otherwise this code isn't executed
# when you run B::Deparse on itself.
my %globalnames;
BEGIN { map($globalnames{$_}++, "SIG", "STDIN", "STDOUT", "STDERR", "INC",
"ENV", "ARGV", "ARGVOUT", "_"); }
{ no strict 'refs'; *{"pp_r$_"} = *{"pp_$_"} for qw< keys each values >; }
# FIXME:
# Different in 5.20. Go over differences to see if okay in 5.20.
sub pp_chdir {
my ($self, $op, $cx) = @_;
if (($op->flags & (OPf_SPECIAL|OPf_KIDS)) == (OPf_SPECIAL|OPf_KIDS)) {
my $kw = $self->keyword("chdir");
my $kid = $self->const_sv($op->first)->PV;
my $code = $kw
. ($cx >= 16 || $self->{'parens'} ? "($kid)" : " $kid");
maybe_targmy(@_, sub { $_[3] }, $code);
} else {
maybe_targmy(@_, \&unop, "chdir")
}
}
sub pp_require
{
( run in 0.777 second using v1.01-cache-2.11-cpan-39bf76dae61 )