$priv{"aassign"}{64} = "COMMON";
$priv{"aassign"}{32} = "PHASH" if $] < 5.009;
$priv{"sassign"}{64} = "BKWARD";
-$priv{$_}{64} = "RTIME" for ("match", "subst", "substcont");
+$priv{$_}{64} = "RTIME" for ("match", "subst", "substcont", "qr");
@{$priv{"trans"}}{1,2,4,8,16,64} = ("<UTF", ">UTF", "IDENT", "SQUASH", "DEL",
"COMPL", "GROWS");
$priv{"repeat"}{64} = "DOLIST";
}
sub concise_sv {
- my($sv, $hr) = @_;
+ my($sv, $hr, $preferpv) = @_;
$hr->{svclass} = class($sv);
$hr->{svclass} = "UV"
if $hr->{svclass} eq "IV" and $sv->FLAGS & SVf_IVisUV;
}
if (class($sv) eq "SPECIAL") {
$hr->{svval} .= ["Null", "sv_undef", "sv_yes", "sv_no"]->[$$sv];
+ } elsif ($preferpv && $sv->FLAGS & SVf_POK) {
+ $hr->{svval} .= cstring($sv->PV);
} elsif ($sv->FLAGS & SVf_NOK) {
$hr->{svval} .= $sv->NV;
} elsif ($sv->FLAGS & SVf_IOK) {
elsif ($h{class} eq "SVOP" or $h{class} eq "PADOP") {
unless ($h{name} eq 'aelemfast' and $op->flags & OPf_SPECIAL) {
my $idx = ($h{class} eq "SVOP") ? $op->targ : $op->padix;
+ my $preferpv = $h{name} eq "method_named";
if ($h{class} eq "PADOP" or !${$op->sv}) {
my $sv = (($curcv->PADLIST->ARRAY)[1]->ARRAY)[$idx];
- $h{arg} = "[" . concise_sv($sv, \%h) . "]";
+ $h{arg} = "[" . concise_sv($sv, \%h, $preferpv) . "]";
$h{targarglife} = $h{targarg} = "";
} else {
- $h{arg} = "(" . concise_sv($op->sv, \%h) . ")";
+ $h{arg} = "(" . concise_sv($op->sv, \%h, $preferpv) . ")";
}
}
}
They're opcode specific, and occur less often than the public ones, so
they're represented by short mnemonics instead of single-chars; see
-L<op.h> for gory details, or try this quick 2-liner:
+F<op.h> for gory details, or try this quick 2-liner:
$> perl -MB::Concise -de 1
DB<1> |x \%B::Concise::priv
Only some of these are used by the standard styles, the others are
provided for you to delve into optree mechanics, should you wish to
add a new style (see L</add_style> below) that uses them. You can
-also add new ones using L<add_callback>.
+also add new ones using L</add_callback>.
=over 4
=head2 Errors
-All detected errors, (invalid arguments, internal errors, etc.) are
-resolved with a die($message). Use an eval if you wish to catch these
-errors and continue processing.
+Errors in rendering (non-existent function-name, non-existent coderef)
+are written to the STDOUT, or wherever you've set it via
+walk_output().
-In particular, B<compile> will die if you've asked for a non-existent
-function-name, a non-existent coderef, or a non-CODE reference.
+Errors using the various *style* calls, and bad args to walk_output(),
+result in die(). Use an eval if you wish to catch these errors and
+continue processing.
=head1 AUTHOR