Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make %ENV available when strict is in use
  • Loading branch information
FROGGS committed Apr 27, 2013
1 parent f8bd973 commit f7d0e77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions STATUS.md
Expand Up @@ -317,9 +317,10 @@ at t/spec/op/die_except.v5:10
------> ⏏sub DESTROY { $_[0]->() }</td></tr>
<tr align=center><td align=left rowspan=2>op/die_exit.v5</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
<tr><td colspan=5>===SORRY!===
Variable '%ENV' is not declared
at t/spec/op/die_exit.v5:49
------> _rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'}⏏ || '';</td></tr>
Unsupported use of /i; in Perl 6 please use :i
at t/spec/op/die_exit.v5:51
------> y $unix_rpt = $env_unix_rpt =~ /^[ET1]/i⏏;
</td></tr>
<tr align=center><td align=left rowspan=2>op/die_unwind.v5</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
<tr><td colspan=5>===SORRY!===
Semicolon form of package definition not allowed in subscope;
Expand Down Expand Up @@ -1708,9 +1709,8 @@ Could not find integer in any of: ../lib
</td></tr>
<tr align=center><td align=left rowspan=2>op/numconvert.v5</td><td>0</td><td>15</td><td>0</td><td>0</td><td>15</td></tr>
<tr><td colspan=5>===SORRY!===
Variable '%ENV' is not declared
at t/spec/op/numconvert.v5:48
------> $max_chain = $ENV{PERL_TEST_NUMCONVERTS}⏏ || 2;</td></tr>
Could not find integer in any of: ../lib
</td></tr>
<tr align=center><td align=left rowspan=2>op/utf8cache.v5</td><td>0</td><td>15</td><td>0</td><td>0</td><td>15</td></tr>
<tr><td colspan=5>===SORRY!===
Two terms in a row
Expand Down
11 changes: 5 additions & 6 deletions lib/Perl6/P5Grammar.pm
Expand Up @@ -333,12 +333,7 @@ role STD5 {
my $name := $varast.name;
if $name ne '%_' && $name ne '@_' && !$*W.is_lexical($name) {
if $var<sigil> ne '&' {
if $is_strict {
my @suggestions := $*W.suggest_lexicals($name);
$*W.throw($var, ['X', 'Undeclared'], symbol => $varast.name(), suggestions => @suggestions);
}
else {
# Declare the variable if 'strict' is not in use.
if $name eq '%ENV' || !$is_strict {
my $BLOCK := $*W.cur_lexpad();
$varast.scope('lexical');

Expand All @@ -354,6 +349,10 @@ role STD5 {
!! $*W.symbol_lookup([$name], $/, :package_only(1), :lvalue(1))
));
}
else {
my @suggestions := $*W.suggest_lexicals($name);
$*W.throw($var, ['X', 'Undeclared'], symbol => $varast.name(), suggestions => @suggestions);
}
}
else {
$var.CURSOR.add_mystery($varast.name, $var.to, 'var');
Expand Down

0 comments on commit f7d0e77

Please sign in to comment.