Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit c38c659528588cdafa1e1fb212f098cb763966ed 1 parent 1d43629
Jonathan Worthington authored June 06, 2013
2  src/Perl6/Actions.nqp
@@ -5302,7 +5302,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
5302 5302
     sub add_placeholder_parameter($/, $sigil, $ident, :$named, :$pos_slurpy, :$named_slurpy, :$full_name) {
5303 5303
         # Ensure we're not trying to put a placeholder in the mainline.
5304 5304
         my $block := $*W.cur_lexpad();
5305  
-        if $block<IN_DECL> eq 'mainline' {
  5305
+        if $block<IN_DECL> eq 'mainline' || $block<IN_DECL> eq 'eval' {
5306 5306
             $*W.throw($/, ['X', 'Placeholder', 'Mainline'],
5307 5307
                 placeholder => $full_name,
5308 5308
             );
7  src/Perl6/Grammar.nqp
@@ -766,13 +766,16 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
766 766
             # from e.g. REPL) and the real UNIT.
767 767
             $*UNIT_OUTER := $*W.push_lexpad($/);
768 768
             $*UNIT := $*W.push_lexpad($/);
769  
-            $*UNIT<IN_DECL> := 'mainline';
770 769
             
771 770
             # If we already have a specified outer context, then that's
772 771
             # our setting. Otherwise, load one.
773 772
             my $have_outer := nqp::defined(%*COMPILING<%?OPTIONS><outer_ctx>);
774  
-            unless $have_outer {
  773
+            if $have_outer {
  774
+                $*UNIT<IN_DECL> := 'eval';
  775
+            }
  776
+            else {
775 777
                 $*SETTING := $*W.load_setting($/, %*COMPILING<%?OPTIONS><setting> // 'CORE');
  778
+                $*UNIT<IN_DECL> := 'mainline';
776 779
             }
777 780
             $/.CURSOR.unitstart();
778 781
             try {

0 notes on commit c38c659

Please sign in to comment.
Something went wrong with that request. Please try again.