Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid spurious error on &[+], reduce reparsing in check_variable
  • Loading branch information
sorear committed May 27, 2012
1 parent 9d10d16 commit f54d02c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/NieczaActions.pm6
Expand Up @@ -2000,12 +2000,15 @@ method check_strict() {
# redo a lot of the same scanning.
method check_variable ($variable) {
return () unless defined $variable;
my $vast = $variable.ast;
return () if $vast<term>; # pseudo-var
my $name = $variable.Str;
my $here = $variable.CURSOR.cursor($variable.from);
$here.deb("check_variable $name") if $*DEBUG +& DEBUG::symtab;
my ($sigil, $twigil, $first) = $name ~~ /(\$|\@|\%|\&)(\W*)(.?)/;
my $sigil = $vast<sigil> // '';
my $twigil = $vast<twigil> // '';
my $first = substr($vast<name> // '', 0, 1);
$variable.ast<checked> || $here.sorry("do_variable_reference must always precede check_variable");
($first,$twigil) = ($twigil, '') if $first eq '';
given $twigil {
when '' {
my $ok = 0;
Expand Down

0 comments on commit f54d02c

Please sign in to comment.