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

Commit

Permalink
Browse files Browse the repository at this point in the history
Verify that right associativity is working (it is).
  • Loading branch information
pmichaud committed Oct 19, 2009
1 parent 2d1ddd7 commit 7574241
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/NQP/Actions.pm
Expand Up @@ -2,10 +2,11 @@ class NQP::Actions is HLL::Actions;

# These will eventually go in NQP::Grammar.
NQP::Grammar.O(':prec<x=>, :assoc<unary>', '%autoincrement');
NQP::Grammar.O(':prec<w=>, :assoc<left>', '%exponentiation');
NQP::Grammar.O(':prec<w=>, :assoc<left>', '%exponentiation');
NQP::Grammar.O(':prec<v=>, :assoc<unary>', '%symbolic_unary');
NQP::Grammar.O(':prec<u=>, :assoc<left>', '%multiplicative');
NQP::Grammar.O(':prec<t=>, :assoc<left>', '%additive');
NQP::Grammar.O(':prec<u=>, :assoc<left>', '%multiplicative');
NQP::Grammar.O(':prec<t=>, :assoc<left>', '%additive');
NQP::Grammar.O(':prec<i=>, :assoc<right>', '%assignment');

method TOP($/) { make $<EXPR>.ast; }

Expand Down
1 change: 1 addition & 0 deletions src/NQP/Grammar.pm
Expand Up @@ -12,6 +12,7 @@ token infix:sym</> { $<sym>=['/'] <O('%multiplicative, :pirop<div>')> }
token infix:sym<%> { $<sym>=['%'] <O('%multiplicative, :pirop<mod>')> }
token infix:sym<+> { $<sym>=['+'] <O('%additive , :pirop<add>')> }
token infix:sym<-> { $<sym>=['-'] <O('%additive , :pirop<sub>')> }
token infix:sym<=> { $<sym>=['='] <O('%assignment')> }

token prefix:sym<-> { $<sym>=['-'] <O('%symbolic_unary')> }
token prefix:sym<--> { $<sym>=['--'] <O('%autoincrement')> }
Expand Down

0 comments on commit 7574241

Please sign in to comment.