Skip to content

Commit

Permalink
Add precedence levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcurtis committed Jul 20, 2010
1 parent 9f9b948 commit 830e749
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Squaak/Grammar.pm
Expand Up @@ -139,8 +139,13 @@ token quote:sym<"> { <?["]> <quote_EXPR: ':qq'> }
## Operators

INIT {
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');
Squaak::Grammar.O(':prec<t>, :assoc<left>', '%additive');
Squaak::Grammar.O(':prec<s>, :assoc<left>', '%relational');
Squaak::Grammar.O(':prec<r>, :assoc<left>', '%conjunction');
Squaak::Grammar.O(':prec<q>, :assoc<left>', '%disjunction');
}

token circumfix:sym<( )> { '(' <.ws> <EXPR> ')' }
Expand Down

0 comments on commit 830e749

Please sign in to comment.