LibStub version of TagCompiler-1.0, used in Assessment and Aloft.
TagCompiler allows configuration via tags, specifically useful for display components, allowing easy arrangement and modification of said display.
Here's the inline documentation, for reference: TextTag:= { Statement } @
RawTag:= RValue @
NumberTag:= RValue @
Statement:= literal | "[" RValue "]"
RValue:= Logical
Logical:= Relation { "&" | "|" } Relation
Relation:= Concat [ ("==" | "=" | ">" | "<" | "<=" | ">=") Concat ]
Concat:= Expression { ("." | "..") Expression }
Expression:= Term { ("+" | "-") Term }
Factor:= Chain { ("*" | "/") Chain }
Chain:= Unary { ":" Unary }
Unary:= [ "" | "-" ] Primary
Primary:= ConstantNumber | ConstantString | Identifier ["(" ParameterList ")"] | "(" RValue ")"
ParameterList:= RValue {, RValue }
TagCompiler:Compile(tag, tagData, resultType)
tagData is a structure that optionally has:
tagname.data
tagname.events
tagname.overrideEvents
tagname.guaranteeResult
tagname.noGuaranteeChange
tagname.numeric
parameterTypes (Array of either "raw", "number" or "string")
And must have one of:
tagname.tableData
tagname.string
tagname.method (will be called with the input parameter, prior result and any parameters)
tagname.compileString
For methods or compileStrings that require parameters, it must contain
tagname.parameterTypes
resultType is "string", "number", or "raw"
the result of CreateTag is a table with
data - a list of data elements required, which is all of the tag's .data lists
events - a list of the events required, which is a list of all tag's .events minus .overrideEvents
method - call with input parameter
tag - the tag used
Facts
- Date created
- 19 Mar 2009
- Category
- Last update
- 19 Mar 2009
- Development stage
- Abandoned
- License
- All Rights Reserved