Skip to main content

Class: TemplateParser

Implements

Constructors

new TemplateParser()

new TemplateParser(environment): TemplateParser

Parameters

environment: Environment

Returns

TemplateParser

Defined in

src/parse.ts:39

Properties

environment

readonly environment: Environment

Defined in

src/parse.ts:39

Methods

getTag()

protected getTag(token): Tag

Parameters

token: Token

Returns

Tag

Defined in

src/parse.ts:84


parse()

parse(stream): Root

Parameters

stream: TokenStream

Returns

Root

Implementation of

Parser.parse

Defined in

src/parse.ts:41


parseBlock()

parseBlock(stream, end, token?): BlockNode

Parse a block of tokens from the given stream until an end tag is found or the end of the stream is reached.

Parameters

stream: TokenStream

A template token stream.

end: Set<string>

A set of tag names that indicate the end of the block.

token?: Token

The token to store on the block. Defaults to the current token in the stream.

Returns

BlockNode

Implementation of

Parser.parseBlock

Defined in

src/parse.ts:55


parseLiquid()

parseLiquid(stream): BlockNode

Like parseBlock, but read until the end of the stream. Useful for the liquid tag.

Parameters

stream: TokenStream

A template token stream.

Returns

BlockNode

Implementation of

Parser.parseLiquid

Defined in

src/parse.ts:75


parseStatement()

protected parseStatement(stream): Node

Parameters

stream: TokenStream

Returns

Node

Defined in

src/parse.ts:91