Skip to content
Permalink
Browse files

Add $*INSIDE-EVAL dynamic variable

So that code can figure out it is running inside an EVAL.  Which can
be useful when e.g. determining whether a MAIN should be run or not.
Not sure whether this should be considered public or not.
  • Loading branch information...
lizmat committed Oct 11, 2018
1 parent 8cc3d5d commit 73b7c60392ee5b2382b5535e2aa7c3ea96f315bc
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/core/ForeignCode.pm6
@@ -52,6 +52,7 @@ proto sub EVAL($code is copy where Blob|Cool|Callable, Str() :$lang = 'perl6', P
# currently compiling compilation unit

my $LANG := $context<%?LANG> || CALLERS::<%?LANG>;
my $*INSIDE-EVAL = 1;
my $compiled := $compiler.compile:
$code,
:outer_ctx($eval_ctx),

0 comments on commit 73b7c60

Please sign in to comment.
You can’t perform that action at this time.