Quantcast

Fix precedence of "not" to be above "and/or" but below comparisons.

Johnny C. Lam [07-16-14 - 00:34]
Fix precedence of "not" to be above "and/or" but below comparisons.

This fixes ticket 384 by @Draugrs, where expressions like:

   not IcyVeinsCooldownRemains() > 0

was being parsed as:

   (not IcyVeinsCooldownRemains()) > 0

instead of:

   not (IcyVeinsCooldownRemains() > 0)
Filename
OvaleAST.lua
diff --git a/OvaleAST.lua b/OvaleAST.lua
index 4d9f0e4..1019997 100644
--- a/OvaleAST.lua
+++ b/OvaleAST.lua
@@ -158,7 +158,7 @@ local STRING_LOOKUP_FUNCTION = {

 -- Unary and binary operators with precedence.
 local UNARY_OPERATOR = {
-	["not"] = { "logical", 50 },
+	["not"] = { "logical", 15 },
 	["-"]   = { "arithmetic", 50 },
 }
 local BINARY_OPERATOR = {