Fix ticket 301 - Allow Define() to take decimal values.
Johnny C. Lam [10-19-13 - 07:52]
Fix ticket 301 - Allow Define() to take decimal values.
Extend Define() to allow for non-alphanumeric values. Also allow for "_",
".", and "=" in the value. Spaces are still prohibited.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1065 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 1b47032..04fdd9a 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -664,7 +664,7 @@ end
-- Compile non-function and non-icon declarations.
local function CompileDeclarations(text)
-- Define(CONSTANTE valeur)
- text = strgsub(text, "Define%s*%(%s*([%w_]+)%s+(%w+)%s*%)", ParseDefine)
+ text = strgsub(text, "Define%s*%(%s*([%w_]+)%s+([%w_.=]+)%s*%)", ParseDefine)
-- On remplace les constantes par leur valeur
text = strgsub(text, "([%w_]+)", ReplaceDefine)