Skip to main content

Interface: Parser

Methods

parse()

parse(stream): Root

Parameters

stream: TokenStream

Returns

Root

Defined in

src/parse.ts:15


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

Defined in

src/parse.ts:27


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

Defined in

src/parse.ts:35