Skip to main content

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

CaseTag

Properties

block

readonly block: true = true

Defined in

src/builtin/tags/case.ts:50


end

readonly end: string = TAG_ENDCASE

Defined in

src/builtin/tags/case.ts:52


name

readonly name: string = TAG_CASE

Defined in

src/builtin/tags/case.ts:51


nodeClass

protected nodeClass: typeof CaseNode = CaseNode

Defined in

src/builtin/tags/case.ts:53


DELIM_TOKENS

protected static DELIM_TOKENS: Set<string>

Defined in

src/builtin/tags/case.ts:48


END_CASE_BLOCK

protected static END_CASE_BLOCK: Set<string>

Defined in

src/builtin/tags/case.ts:47


END_WHEN_BLOCK

protected static END_WHEN_BLOCK: Set<string>

Defined in

src/builtin/tags/case.ts:40

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

Node

Implementation of

Tag.parse

Defined in

src/builtin/tags/case.ts:55


parse_case_expression()

protected parse_case_expression(expr, startIndex): Expression

Parameters

expr: string

startIndex: number

Returns

Expression

Defined in

src/builtin/tags/case.ts:119


parse_when_expression()

protected parse_when_expression(expr, startIndex): Expression[]

Parameters

expr: string

startIndex: number

Returns

Expression[]

Defined in

src/builtin/tags/case.ts:126