mirror of
https://github.com/parnic/LibDogTag-3.0.git
synced 2025-06-16 20:20:14 -05:00
- instead of registering tags as strings, they will be registered as functions. - add ability to mark tags as static, which means if all args are literal or static (or there are no args), then the function will be run on compiletime rather than runtime - remove number flattening in parser (e.g. 1/4 => 0.25) - remove globals field and FakeGlobal system - make a lot of error messages better
29 lines
582 B
Lua
29 lines
582 B
Lua
local MAJOR_VERSION = "LibDogTag-3.0"
|
|
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) or 0
|
|
|
|
if MINOR_VERSION > _G.DogTag_MINOR_VERSION then
|
|
_G.DogTag_MINOR_VERSION = MINOR_VERSION
|
|
end
|
|
|
|
local DogTag, oldMinor = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
|
|
_G.DogTag_MINOR_VERSION = nil
|
|
if not DogTag then
|
|
_G.DogTag_funcs = nil
|
|
return
|
|
end
|
|
|
|
local oldLib
|
|
if next(DogTag) ~= nil then
|
|
oldLib = {}
|
|
for k,v in pairs(DogTag) do
|
|
oldLib[k] = v
|
|
DogTag[k] = nil
|
|
end
|
|
end
|
|
DogTag.oldLib = oldLib
|
|
|
|
for _,v in ipairs(_G.DogTag_funcs) do
|
|
v(DogTag)
|
|
end
|
|
|
|
_G.DogTag_funcs = nil |