Skip to content
This repository
Browse code

Avoid spurious error on &[+], reduce reparsing in check_variable

  • Loading branch information...
commit f54d02cb955dc98e2d3901b26a273776e747970f 1 parent 9d10d16
Stefan O'Rear authored

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 2 src/NieczaActions.pm6
7 src/NieczaActions.pm6
@@ -2000,12 +2000,15 @@ method check_strict() {
2000 2000 # redo a lot of the same scanning.
2001 2001 method check_variable ($variable) {
2002 2002 return () unless defined $variable;
  2003 + my $vast = $variable.ast;
  2004 + return () if $vast<term>; # pseudo-var
2003 2005 my $name = $variable.Str;
2004 2006 my $here = $variable.CURSOR.cursor($variable.from);
2005 2007 $here.deb("check_variable $name") if $*DEBUG +& DEBUG::symtab;
2006   - my ($sigil, $twigil, $first) = $name ~~ /(\$|\@|\%|\&)(\W*)(.?)/;
  2008 + my $sigil = $vast<sigil> // '';
  2009 + my $twigil = $vast<twigil> // '';
  2010 + my $first = substr($vast<name> // '', 0, 1);
2007 2011 $variable.ast<checked> || $here.sorry("do_variable_reference must always precede check_variable");
2008   - ($first,$twigil) = ($twigil, '') if $first eq '';
2009 2012 given $twigil {
2010 2013 when '' {
2011 2014 my $ok = 0;

0 comments on commit f54d02c

Please sign in to comment.
Something went wrong with that request. Please try again.