Skip to content

Commit

Permalink
backport niecza's undefined &foo detector
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Mar 2, 2012
1 parent 9c3ef6d commit 137d5f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions STD.pm6
Expand Up @@ -5926,15 +5926,17 @@ method check_variable ($variable) {
when '' {
my $ok = 0;
$ok ||= $*IN_DECL;
$ok ||= $sigil eq '&';
$ok ||= $first lt 'A';
$ok ||= $first eq '¢';
$ok ||= self.is_known($name);
$ok ||= $name ~~ /.\:\:/ && $name !~~ /MY|UNIT|OUTER|SETTING|CORE/;
if not $ok {
my $id = $name;
$id ~~ s/^\W\W?//;
if $name eq '@_' or $name eq '%_' {
if $sigil eq '&' {
$here.add_mystery($variable.<sublongname>, self.pos, 'var')
}
elsif $name eq '@_' or $name eq '%_' {
$here.add_placeholder($name);
}
else { # guaranteed fail now
Expand Down

0 comments on commit 137d5f5

Please sign in to comment.