Class: CaseTag
A class that implements the Tag interface is responsible for
parsing one or more tokens from a token stream, and returning
an ast.Node to be added into the abstract syntax tree.
Implements
Constructors
new CaseTag()
new CaseTag():
CaseTag
Returns
Properties
block
readonlyblock:true=true
Defined in
end
readonlyend:string=TAG_ENDCASE
Defined in
name
readonlyname:string=TAG_CASE
Defined in
nodeClass
protectednodeClass: typeofCaseNode=CaseNode
Defined in
DELIM_TOKENS
protectedstaticDELIM_TOKENS:Set<string>
Defined in
END_CASE_BLOCK
protectedstaticEND_CASE_BLOCK:Set<string>
Defined in
END_WHEN_BLOCK
protectedstaticEND_WHEN_BLOCK:Set<string>
Defined in
Methods
parse()
parse(
stream,environment):Node
Create a syntax tree node by parsing tokens from the token stream.
If implementing a block tag (one with a start and end tag), the stream should be left with the end tag as its current token.
Parameters
• stream: TokenStream
A stream of template tokens.
• environment: Environment
The active environment.
Returns
Implementation of
Defined in
parse_case_expression()
protectedparse_case_expression(expr,startIndex):Expression
Parameters
• expr: string
• startIndex: number
Returns
Defined in
parse_when_expression()
protectedparse_when_expression(expr,startIndex):Expression[]
Parameters
• expr: string
• startIndex: number