Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
REPL6: Implement RAKUDO_DISABLE_MULTILINE
  • Loading branch information
hoelzro committed Mar 4, 2016
1 parent dcb9738 commit e2187cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/REPL.pm
Expand Up @@ -131,6 +131,7 @@ class REPL is export { # XXX no need for is export later
also does Completions;

has Mu $.compiler;
has Bool $!multi-line-enabled;

# XXX print fallback messages
method !load-line-editor() {
Expand All @@ -154,6 +155,7 @@ class REPL is export { # XXX no need for is export later
}

method interactive(Mu \compiler, Mu \adverbs) {
$!multi-line-enabled = !%*ENV<RAKUDO_DISABLE_MULTILINE>;
$!compiler = compiler;
self!load-line-editor();
}
Expand All @@ -162,15 +164,15 @@ class REPL is export { # XXX no need for is export later
try {
CATCH {
when X::Syntax::Missing {
if .pos == code.chars {
if $!multi-line-enabled && .pos == code.chars {
adverbs<more_input> = 1;
return;
}
.throw;
}

when X::Comp::FailGoal {
if .pos == code.chars {
if $!multi-line-enabled && .pos == code.chars {
adverbs<more_input> = 1;
return;
}
Expand Down

0 comments on commit e2187cd

Please sign in to comment.