Implements a Mustache parser class.
Description
The MustacheParser class allows you to implement a Mustache parser.
Properties
initialTokens
List of original Mustache tokens.
public
initialTokens(): MustacheToken[]
- returns: MustacheToken[] - original mustache tokens.
originalTokens
List of original Mustache tokens.
public
originalTokens(): Token[]
- returns: Token[] - original Mustache tokens.
public
originalTokens(value: Token[])
- value: Token[] - original Mustache tokens.
resultTokens
List of parsed Mustache tokens.
public
resultTokens(): MustacheToken[]
- returns: MustacheToken[] - parsed Mustache tokens.
template
Mustache template.
public
template(): string
- returns: string - Mustache template.
public
template(value: string)
- value: string - Mustache template.
variableNames
List of found variable names.
public
variableNames(): string[]
- returns: string[] - found variable names.
Instance methods
clear
Clears parsing results.
public
clear(): void
parseString
Sets a new Mustache string and parses it into internal byte code.
public
parseString(mustache: string): void
- mustache: string - new Mustache string.
parseTokens
Sets a new mustache Token and parses it into internal byte code.
public
parseTokens(tokens: Token[]): void
- mustache: Token[] - new Mustache string.