From aec40650b961bcd040f57b7f6bf53cfb798936ec Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sat, 30 Mar 2013 01:52:00 +0000 Subject: [PATCH] Fix operator precedence error that was causing DK script issues. Ovale was incorrectly parsing: a + b * {c / d} as: {a + b} * {c + d} This change makes it correctly parse as: a + {b * {c / d}} This error was been in Ovale since MoP was released but it takes a rather complex script to trigger it. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@869 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleCompile.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OvaleCompile.lua b/OvaleCompile.lua index 7cfe931..9694353 100644 --- a/OvaleCompile.lua +++ b/OvaleCompile.lua @@ -525,7 +525,23 @@ local function ParseCommands(text) text = strgsub(text, "(%w+)%.?(%w*)%s*%((.-)%)", ParseFunction) text = strgsub(text, "(%d+%.?%d*)s", ParseTime) text = strgsub(text, "([^%w])(%d+%.?%d*)", ParseNumber) + text = strgsub(text, "{([node%d ]*)}", ParseGroup) + if was == text then + break + end + end + + while true do + local was = text text = strgsub(text, "node(%d+)%s*([%*%/%%])%s*node(%d+)", ParseOp) + text = strgsub(text, "{([node%d ]*)}", ParseGroup) + if was == text then + break + end + end + + while true do + local was = text text = strgsub(text, "node(%d+)%s*([%+%-])%s*node(%d+)", ParseOp) text = strgsub(text, "{([node%d ]*)}", ParseGroup) if was == text then -- 1.7.9.5