Permalink
Browse files

Fix $/ and $! visibility in eval/REPL.

  • Loading branch information...
jnthn committed Jun 6, 2013
1 parent 1d43629 commit c38c659528588cdafa1e1fb212f098cb763966ed
Showing with 6 additions and 3 deletions.
  1. +1 −1 src/Perl6/Actions.nqp
  2. +5 −2 src/Perl6/Grammar.nqp
View
@@ -5302,7 +5302,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
sub add_placeholder_parameter($/, $sigil, $ident, :$named, :$pos_slurpy, :$named_slurpy, :$full_name) {
# Ensure we're not trying to put a placeholder in the mainline.
my $block := $*W.cur_lexpad();
- if $block<IN_DECL> eq 'mainline' {
+ if $block<IN_DECL> eq 'mainline' || $block<IN_DECL> eq 'eval' {
$*W.throw($/, ['X', 'Placeholder', 'Mainline'],
placeholder => $full_name,
);
View
@@ -766,13 +766,16 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
# from e.g. REPL) and the real UNIT.
$*UNIT_OUTER := $*W.push_lexpad($/);
$*UNIT := $*W.push_lexpad($/);
- $*UNIT<IN_DECL> := 'mainline';
# If we already have a specified outer context, then that's
# our setting. Otherwise, load one.
my $have_outer := nqp::defined(%*COMPILING<%?OPTIONS><outer_ctx>);
- unless $have_outer {
+ if $have_outer {
+ $*UNIT<IN_DECL> := 'eval';
+ }
+ else {
$*SETTING := $*W.load_setting($/, %*COMPILING<%?OPTIONS><setting> // 'CORE');
+ $*UNIT<IN_DECL> := 'mainline';
}
$/.CURSOR.unitstart();
try {

0 comments on commit c38c659

Please sign in to comment.