Permalink
Browse files

squaak: parse sub calls as expressions

  • Loading branch information...
1 parent 4248232 commit cf360334c11b49defbce4a4e24cc544e023434d6 @Benabik Benabik committed Dec 5, 2011
@@ -365,6 +365,7 @@ method quote:sym<'>($/) { make $<quote_EXPR>.ast; }
method quote:sym<">($/) { make $<quote_EXPR>.ast; }
method circumfix:sym<( )>($/) { make $<EXPR>.ast; }
+method postcircumfix:sym<( )>($/) { make $<arguments>.ast }
method named_field($/) {
my $past := $<EXPR>.ast;
@@ -159,6 +159,7 @@ token quote:sym<"> { <?["]> <quote_EXPR: ':qq'> }
## Operators
INIT {
+ Squaak::Grammar.O(':prec<x>, :assoc<unary>', '%methodop');
Squaak::Grammar.O(':prec<w>, :assoc<unary>', '%unary-negate');
Squaak::Grammar.O(':prec<v>, :assoc<unary>', '%unary-not');
Squaak::Grammar.O(':prec<u>, :assoc<left>', '%multiplicative');
@@ -169,6 +170,9 @@ INIT {
}
token circumfix:sym<( )> { '(' <.ws> <EXPR> ')' }
+token postcircumfix:sym<( )> {
+ <arguments> <O( '%methodop, :pasttype<call>' )>
+}
rule circumfix:sym<[ ]> {
'[' [<EXPR> ** ',']? ']'

0 comments on commit cf36033

Please sign in to comment.