Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
first step towards "no strict;"
No way to test it yet, because $*STRICT is never set to a false valu
  • Loading branch information
moritz committed Jun 18, 2012
1 parent cb28ebf commit bfcce00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -1209,7 +1209,16 @@ class Perl6::Actions is HLL::Actions {
# inside double quotes fixes the most common case, but fails to
# catch undeclared variables in double-quoted strings.
if $sigil ne '&' && !$*IN_DECL && ($*QSIGIL eq '' || $*QSIGIL eq '$') && !$*W.is_lexical($past.name) {
$*W.throw($/, ['X', 'Undeclared'], symbol => $past.name());
if $*STRICT {
$*W.throw($/, ['X', 'Undeclared'], symbol => $past.name());
}
else {
$*UNIT_OUTER[0].push(PAST::Var.new(
:name($past.name), :scope('lexical'), :isdecl(1),
:viviself($*W.symbol_lookup([$past.name], $/, :package_only(1), :lvalue(1)))));
$*UNIT_OUTER.symbol($past.name, :scope('lexical'));

}
}
elsif $sigil eq '&' {
$past.viviself(PAST::Var.new(:name('Nil'), :scope('lexical_6model')));
Expand Down
1 change: 1 addition & 0 deletions src/Perl6/Grammar.pm
Expand Up @@ -426,6 +426,7 @@ grammar Perl6::Grammar is HLL::Grammar {
:my $*ALLOW_CODE := 0; # pod stuff
:my $*POD_IN_FORMATTINGCODE := 0; # pod stuff
:my $*IN_REGEX_ASSERTION := 0;
:my $*STRICT := 1;

# Various interesting scopes we'd like to keep to hand.
:my $*GLOBALish;
Expand Down

0 comments on commit bfcce00

Please sign in to comment.