Skip to content

Commit

Permalink
Severely reduce what can go in lhs, and move the is_a_sub check farth…
Browse files Browse the repository at this point in the history
…er up the chain so that it doesn't interfere with assignment.
  • Loading branch information
treed committed Jul 21, 2009
1 parent 3b2e0db commit da35935
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/parser/actions.pm
Expand Up @@ -240,7 +240,11 @@ method indexed($/) {
method variable($/, $key) {
my $past;
if $key eq 'varname' {
$past := $/<varname>.ast();
my $varname := $/<varname>;
$past := $varname.ast();
if is_a_sub(~$varname) { # unary sub
$past := PAST::Op.new(:pasttype('call'), :node($varname), $past);
}
}
elsif $key eq 'self' {
$past := PAST::Op.new(:inline('%r = self'));
Expand All @@ -252,11 +256,7 @@ method variable($/, $key) {
}

method varname($/, $key) {
my $past := $/{$key}.ast();
if is_a_sub(~$/) { # unary sub
$past := PAST::Op.new( :pasttype('call'), :node($/), $past );
}
make $past;
make $/{$key}.ast();
}

method global($/) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/grammar.pg
Expand Up @@ -106,7 +106,7 @@ rule mlhs {
}

token lhs {
| <basic_primary> {*} #= basic_primary
| <varname> {*} #= varname
}

token indexed {
Expand Down

0 comments on commit da35935

Please sign in to comment.