Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Support contextualizers; passes 35-prefix-sigil.t.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 30, 2009
1 parent 0772654 commit 0bee741
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/NQP/Actions.pm
Expand Up @@ -498,6 +498,15 @@ method circumfix:sym<ang>($/) { make $<quote_EXPR>.ast; }

method circumfix:sym<{ }>($/) { make $<pblock>.ast; }

method circumfix:sym<sigil>($/) {
my $name := ~$<sigil> eq '@' ?? 'list' !!
~$<sigil> eq '%' ?? 'hash' !!
'item';
make PAST::Op.new( :pasttype('callmethod'), :name($name), $<semilist>.ast );
}

method semilist($/) { make $<statement>.ast }

method postcircumfix:sym<[ ]>($/) {
make PAST::Var.new( $<EXPR>.ast , :scope('keyed_int'),
:viviself('Undef'),
Expand Down
3 changes: 3 additions & 0 deletions src/NQP/Grammar.pm
Expand Up @@ -295,6 +295,9 @@ token quote:sym<Q:PIR> { 'Q:PIR' <.ws> <quote_EXPR> }
token circumfix:sym<( )> { '(' <.ws> <EXPR> ')' }
token circumfix:sym<ang> { <?[<]> <quote_EXPR: ':q', ':w'> }
token circumfix:sym<{ }> { <?[{]> <pblock> }
token circumfix:sym<sigil> { <sigil> '(' ~ ')' <semilist> }

rule semilist { <statement> }

## Operators

Expand Down

0 comments on commit 0bee741

Please sign in to comment.