Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Eliminate $!commandline_{banner|prompt}, replace with interactive_* m…
…ethods.
  • Loading branch information
pmichaud committed Jul 24, 2011
1 parent 5134a59 commit 9fe040c
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/HLL/Compiler.pm
Expand Up @@ -10,8 +10,6 @@ class HLL::Compiler {
has @!stages;
has $!parsegrammar;
has $!parseactions;
has $!commandline_banner;
has $!commandline_prompt;
has @!cmdoptions;
has $!usage;
has $!compiler_progname;
Expand Down Expand Up @@ -144,7 +142,7 @@ class HLL::Compiler {

my $target := pir::downcase(%adverbs<target>);

pir::print__vPS( pir::getinterp__P().stderr_handle(), self.commandline_banner );
nqp::print(pir::getinterp__P().stderr_handle(), self.interactive_banner);

my $stdin := pir::getinterp__P().stdin_handle();
my $encoding := ~%adverbs<encoding>;
Expand All @@ -156,7 +154,7 @@ class HLL::Compiler {
while 1 {
last unless $stdin;

my $prompt := self.commandline_prompt // '> ';
my $prompt := self.interactive_prompt // '> ';
my $code := $stdin.readline_interactive(~$prompt);

last if pir::isnull($code);
Expand Down Expand Up @@ -252,19 +250,9 @@ class HLL::Compiler {
$!parseactions;
}

method commandline_banner($value?) {
if pir::defined($value) {
$!commandline_banner := $value;
}
$!commandline_banner;
}
method interactive_banner() { '' }

method commandline_prompt($value?) {
if pir::defined($value) {
$!commandline_prompt := $value;
}
$!commandline_prompt;
}
method interactive_prompt() { '> ' }

method compiler_progname($value?) {
if pir::defined($value) {
Expand Down

0 comments on commit 9fe040c

Please sign in to comment.