Skip to content

Commit

Permalink
Bring our parsing of array and hash subscripting in line with STD. Th…
Browse files Browse the repository at this point in the history
…is also unbreaks zen slices.
  • Loading branch information
jnthn committed Apr 15, 2010
1 parent 5fd0669 commit 78faa0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/Perl6/Actions.pm
Expand Up @@ -2180,13 +2180,15 @@ method postfixish($/) {
}

method postcircumfix:sym<[ ]>($/) {
make PAST::Op.new( $<EXPR>.ast, :name('!postcircumfix:<[ ]>'),
:pasttype('call'), :node($/) );
my $past := PAST::Op.new( :name('!postcircumfix:<[ ]>'), :pasttype('call'), :node($/) );
if $<semilist><statement> { $past.push($<semilist>.ast); }
make $past;
}

method postcircumfix:sym<{ }>($/) {
make PAST::Op.new( $<EXPR>.ast, :name('!postcircumfix:<{ }>'),
:pasttype('call'), :node($/) );
my $past := PAST::Op.new( :name('!postcircumfix:<{ }>'), :pasttype('call'), :node($/) );
if $<semilist><statement> { $past.push($<semilist>.ast); }
make $past;
}

method postcircumfix:sym<ang>($/) {
Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/Grammar.pm
Expand Up @@ -1550,13 +1550,13 @@ token dottyopish {

token postcircumfix:sym<[ ]> {
:my $*QSIGIL := '';
'[' ~ ']' [ <.ws> <EXPR> ]
'[' ~ ']' [ <.ws> <semilist> ]
<O('%methodcall')>
}

token postcircumfix:sym<{ }> {
:my $*QSIGIL := '';
'{' ~ '}' [ <.ws> <EXPR> ]
'{' ~ '}' [ <.ws> <semilist> ]
<O('%methodcall')>
}

Expand Down

0 comments on commit 78faa0c

Please sign in to comment.