Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Add the autoprint hook
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear authored and pmichaud committed May 21, 2010
1 parent def10fd commit 528fb67
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/HLL/Compiler.pm
Expand Up @@ -82,6 +82,10 @@ class HLL::Compiler is PCT::HLLCompiler {
}
}

method autoprint($value) {
pir::say(~$value);
}

method interactive(*%adverbs) {
my $target := pir::downcase(%adverbs<target>);

Expand Down Expand Up @@ -113,12 +117,12 @@ class HLL::Compiler is PCT::HLLCompiler {
};
next if pir::isnull($output);

if $target {
if $target eq 'pir' {
say($output);
} else {
self.dumper($output, $target, |%adverbs);
}
if !$target {
self.autoprint($output);
} elsif $target eq 'pir' {
pir::say($output);
} else {
self.dumper($output, $target, |%adverbs);
}
}
}
Expand Down

0 comments on commit 528fb67

Please sign in to comment.