Skip to content

Instantly share code, notes, and snippets.

@hoelzro
Created December 4, 2015 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoelzro/f6ef23c1234377cf7b4e to your computer and use it in GitHub Desktop.
Save hoelzro/f6ef23c1234377cf7b4e to your computer and use it in GitHub Desktop.
diff --git a/src/Perl6/Compiler.nqp b/src/Perl6/Compiler.nqp
index 3ed4ace..97e344b 100644
--- a/src/Perl6/Compiler.nqp
+++ b/src/Perl6/Compiler.nqp
@@ -222,6 +222,8 @@ class Perl6::Compiler is HLL::Compiler {
}
method readline($stdin, $stdout, $prompt) {
+ my $line;
+
try {
my $ctx := self.context();
if $ctx {
@@ -252,23 +254,22 @@ class Perl6::Compiler is HLL::Compiler {
sorted_set_insert($!completions, $k);
}
}
- nqp::say('passed ctx stuff');
- my $line := $!linenoise($prompt);
- nqp::say('passed linenoise init');
+ $line := $!linenoise($prompt);
if $line.defined {
$!linenoise_add_history($line);
- $line
} else {
- nqp::null_s()
+ $line := nqp::null_s()
}
CATCH {
nqp::say('something failed');
my $super := nqp::findmethod(HLL::Compiler, 'readline');
- $super(self, $stdin, $stdout, $prompt);
+ $line := $super(self, $stdin, $stdout, $prompt);
}
}
+
+ $line
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment