Skip to content

Commit

Permalink
fix negation/infix precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Nov 21, 2019
1 parent a5fe0ca commit 10e9cbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion WDL/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
?expr_core: "(" expr ")"
| literal
| string
| "!" expr -> negate
| "!" expr_core -> negate
| "[" [expr ("," expr)*] ","? "]" -> array
| expr_core "[" expr "]" -> at
Expand Down
5 changes: 4 additions & 1 deletion tests/test_0eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def test_logic(self):
("!!true", "true"),
("!false", "true"),
("!false && true", "true"),
("!(false && true)", "true")
("!false && false", "false"),
("!true && false", "false"),
("!(false && false)", "true"),
("!(false && true)", "true"),
)

def test_arithmetic(self):
Expand Down

0 comments on commit 10e9cbb

Please sign in to comment.