LooseVarsParser
Class: LooseVarsParser
Defined in: packages/tagscript/src/lib/Parsers/LooseVars.ts:17
The loose variable tag represents the transformer for any seeded or defined variables.
This variable implementation is considered loose since it checks whether the variable is
valid during parsing, rather than willAccept.
Example
# Note:- this example assumes you are using define parser
{=(var):This is my variable.}
{var}
# This is my variable.Implements
Constructors
Constructor
new LooseVarsParser(): LooseVarsParser
Returns
LooseVarsParser
Methods
parse()
parse(ctx): string | null
Defined in: packages/tagscript/src/lib/Parsers/LooseVars.ts:22
Parses the given tag.
Returning null or undefined means this parser did not handle the tag, and the interpreter
moves on to the next one that accepted it.
Parameters
ctx
The context of the tag.
Returns
string | null
Implementation of
willAccept()
willAccept(): boolean
Defined in: packages/tagscript/src/lib/Parsers/LooseVars.ts:18
Whether the parser can handle the given tag.
Returns
boolean