const mixinmustache::MustacheToken

mustache::MustacheToken

base mixin for all the token implementations

format

const static Obj? format(Obj? value)

render

abstract Void render(StrBuf output, Obj? context, Str:Mustache partials, Obj?[] callStack, Str indentStr)

singleShot

const static Obj?[] singleShot(Str name, Obj? context, Obj? object, Str childrenSource, Str:Mustache partials, Obj?[] callStack, Str indentStr, MustacheToken? cachedTree, Str otag, Str ctag)

templateSource

abstract Str templateSource()

valueOf

const static Obj? valueOf(Str name, Obj? context, Str:Mustache partials, Obj?[] callStack, Str indentStr, Str otag, Str ctag, Str childrenSource, MustacheToken? cachedTree := null)

1) Split the name on periods; the first part is the name to resolve, any
remaining parts should be retained.
2) Walk the context stack from top to bottom, finding the first context
that is a) a hash containing the name as a key OR b) an object responding
to a method with the given name.
3) If the context is a hash, the data is the value associated with the
name.
4) If the context is an object and the method with the given name has an
arity of 1, the method SHOULD be called with a String containing the
unprocessed contents of the sections; the data is the value returned.
5) Otherwise, the data is the value returned by calling the method with
the given name.
6) If any name parts were retained in step 1, each should be resolved
against a context stack containing only the result from the former
resolution.  If any part fails resolution, the result should be considered
falsey, and should interpolate as the empty string.