Skip to content

Commit

Permalink
Fix for #520
Browse files Browse the repository at this point in the history
  • Loading branch information
rhendric committed Sep 4, 2014
1 parent b02d186 commit 4cbbd93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ast.ls
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ class exports.Binary extends Node

compileMod: (o) ->
ref = o.scope.temporary!
code = "((#{@first.compile o}) % (#ref = #{@second.compile o}) + #ref) % #ref"
code = "(((#{@first.compile o}) % (#ref = #{@second.compile o}) + #ref) % #ref)"
o.scope.free ref
code

Expand Down
2 changes: 2 additions & 0 deletions test/operator.ls
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ eq -1, 7 %% -2
x = 7; x %%= -2
eq -1 x

eq '9', (-1 %% 10).toString!

### Partially applied binary ops
addTwo = (+ 2)
eq 5 addTwo 3
Expand Down

0 comments on commit 4cbbd93

Please sign in to comment.