Permalink
Browse files

backport niecza's undefined &foo detector

  • Loading branch information...
1 parent 9c3ef6d commit 137d5f5c7190436bec2d28c7d0664cfe390cee16 @TimToady TimToady committed Mar 2, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 STD.pm6
View
6 STD.pm6
@@ -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

0 comments on commit 137d5f5

Please sign in to comment.