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

Commit

Permalink
Add circumfix: .
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 19, 2009
1 parent 7574241 commit 29c3519
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/HLL/Actions.pm
Expand Up @@ -36,6 +36,7 @@ method termish($/) {
}

method noun:sym<term>($/) { make $<term>.ast }
method noun:sym<circumfix>($/) { make $<circumfix>.ast }

method integer($/) {
make $<decint>
Expand Down
2 changes: 2 additions & 0 deletions src/HLL/Grammar.pm
Expand Up @@ -10,8 +10,10 @@ grammar HLL::Grammar;
proto token infix { <...> }
proto token prefix { <...> }
proto token postfix { <...> }
proto token circumfix { <...> }

token noun:sym<term> { <term> }
token noun:sym<circumfix> { <circumfix> }

token infixish { <infix> }
token prefixish { <prefix> }
Expand Down
2 changes: 2 additions & 0 deletions src/NQP/Actions.pm
Expand Up @@ -12,6 +12,8 @@ method TOP($/) { make $<EXPR>.ast; }

method term:sym<value>($/) { make $<value>.ast; }

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

method value($/) {
my $past := PAST::Val.new(
:value($<integer>
Expand Down
1 change: 1 addition & 0 deletions src/NQP/Grammar.pm
Expand Up @@ -19,6 +19,7 @@ token prefix:sym<--> { $<sym>=['--'] <O('%autoincrement')> }

token postfix:sym<++> { $<sym>=['++'] <O('%autoincrement')> }

token circumfix:sym<( )> { '(' <EXPR> ')' }

token value {
| <integer>
Expand Down

0 comments on commit 29c3519

Please sign in to comment.