LibDogTag-3.0

API / Compiler.lua

:AddCompilationStep("namespace" , "kind" , func)

Arguments

"namespace"
string - namespace to run the compilation step on
"kind"
string - kind of compilation step, can be "pre", "start", "tag", "tagevents", or "finish"
func
function - the function to run

Example

DogTag:AddCompilationStep("MyNamespace", "start", function(t, ast, kwargTypes, extraKwargs)
	-- do something here
end)

string table

:CreateFunctionFromCode("code" [, nsList] [, kwargs] [, notDebug])

Arguments

"code"
string - a tag sequence
nsList
string - a semicolon-separated list of namespaces. Base is implied
kwargs
table - a dictionary of default kwargs for all tags in the code to receive
notDebug
type - (needs documentation)

Notes

This is mostly used for debugging purposes

Returns

string - a block of code which could have loadstring called on it.

Example

local funcCode = LibStub("LibDogTag-3.0"):CreateFunctionFromCode("[Name]", "Unit", { unit = 'player' })

string table

:Evaluate("code" [, nsList] [, kwargs])

Arguments

"code"
string - the tag sequence to compile and evaluate
nsList
string - a semicolon-separated list of namespaces. Base is implied
kwargs
table - a dictionary of default kwargs for all tags in the code to receive

Returns

string, number, or nil - the resultant generated text number or nil - the expected opacity of the generated text, specified by the [Alpha(num)] tag. nil if not specified. string - the outline style, can be "", "OUTLINE", or "OUTLINE, THICKOUTLINE"

Example

local text = LibStub("LibDogTag-3.0"):Evaluate("[Name]", "Unit", { unit = 'player' })

string

:RemoveAllCompilationSteps("namespace" [, kind])

Arguments

"namespace"
string - namespace to run the compilation step on
kind
string - kind of compilation step, can be "pre", "start", "tag", "tagevents", or "finish", if not specified, then all kinds

Example

DogTag:RemoveAllCompilationSteps("MyNamespace", "start")
DogTag:RemoveAllCompilationSteps("MyNamespace")

:RemoveCompilationStep("namespace" , "kind" , func)

Arguments

"namespace"
string - namespace to run the compilation step on
"kind"
string - kind of compilation step, can be "pre", "start", "tag", "tagevents", or "finish"
func
function - the function to run

Example

DogTag:RemoveCompilationStep("MyNamespace", "start", func)


You must login to post a comment. Don't have an account? Register to get one!