#!./perl
BEGIN {
chdir 't' if -d 't';
}
# indent should return a string indented four spaces times the argument
# this should fail without a reference
# now point it at a sub and see what happens
sub foo {}
my $sub;
# and point it at a real sub and hope the returned ops look alright
# now build some regexes that should match the dumped ops
# split up the output lines into individual ops (terse is, well, terse!)
# use an array here so $_ is modifiable
next unless /\S/;
s/^\s+//;
if (/^([A-Z]+)\s+/) {
my $op = $1;
redo if $_;
}
}
# XXX:
# this tries to get at all tersified optypes in B::Terse
# if you can think of a way to produce AV, NULL, PADOP, or SPECIAL,
# add it to the regex above too. (PADOPs are currently only produced
# under ithreads, though).
#
sub bar {
# OP SVOP COP IV here or in sub definition
# got a GV here
my $foo = $a + $b;
# NV here
$a = 1.234;
# this is awful, but it gives a PMOP
# PVOP, LOOP
}
# make a PV
# make an OP_SUBSTCONT
}
# Schwern's example of finding an RV
sub TIEHANDLE {
}
sub PRINT {
my $self = shift;
}
sub PRINTF {
my $self = shift;
}
sub read {
my $self = shift;
}