From a821f587479e91e0b640cc64d4e1b237f466ec10 Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Sat, 28 Aug 2010 12:17:03 +0200 Subject: [PATCH] change FORBID_PIR from contextual to global; this makes it persist through multiple REPL lines --- src/Perl6/Actions.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index 2ac452a2b32..2e9a874907a 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -4,6 +4,8 @@ our @BLOCK; our @PACKAGE; our $TRUE; +our $FORBID_PIR; + INIT { # initialize @BLOCK and @PACKAGE our @BLOCK := Q:PIR { %r = root_new ['parrot';'ResizablePMCArray'] }; @@ -15,6 +17,8 @@ INIT { Q:PIR { %r = get_hll_global ['PAST';'Compiler'], '%valflags' }; %valflags := 'e'; %valflags := 'e'; + + $FORBID_PIR := 0; } sub xblock_immediate($xblock) { @@ -494,7 +498,7 @@ method statement_control:sym($/) { $*SETTING_MODE := 1; } elsif ~$ eq 'FORBID_PIR' { - $*FORBID_PIR := 1; + $FORBID_PIR := 1; } else { need($); @@ -2033,7 +2037,7 @@ method term:sym($/) { } method term:sym($/) { - if $*FORBID_PIR { + if $FORBID_PIR { pir::die("pir::op forbidden in safe mode\n"); } my $past := $ ?? $[0].ast !! PAST::Op.new( :node($/) ); @@ -2751,7 +2755,7 @@ method quote:sym($/) { make $.ast; } method quote:sym($/) { make $.ast; } method quote:sym($/) { make $.ast; } method quote:sym($/) { - if $*FORBID_PIR { + if $FORBID_PIR { pir::die("Q:PIR forbidden in safe mode\n"); } make PAST::Op.new( :inline( $.ast.value ),