Class: Parser

Hierarchy

  • Parser

Constructors

constructor

+ new Parser(liquid: Liquid): Parser

Defined in parser/parser.ts:22

Parameters:

Name Type
liquid Liquid

Returns: Parser

Properties

Private cache

cache: CacheThenableTemplate[]›› | undefined

Defined in parser/parser.ts:21


Private fs

fs: FS

Defined in parser/parser.ts:20


Private liquid

liquid: Liquid

Defined in parser/parser.ts:19


Private loader

loader: Loader

Defined in parser/parser.ts:22


parseFile

parseFile: function

Defined in parser/parser.ts:17

Type declaration:

▸ (file: string, sync?: undefined | false | true, type?: LookupType, currentFile?: undefined | string): IterableIterator‹any›

Parameters:

Name Type
file string
sync? undefined | false | true
type? LookupType
currentFile? undefined | string

Methods

Private _parseFile

_parseFile(file: string, sync?: undefined | false | true, type: LookupType, currentFile?: undefined | string): IterableIterator‹any›

Defined in parser/parser.ts:76

Parameters:

Name Type Default
file string -
sync? undefined | false | true -
type LookupType LookupType.Root
currentFile? undefined | string -

Returns: IterableIterator‹any›


Private _parseFileCached

_parseFileCached(file: string, sync?: undefined | false | true, type: LookupType, currentFile?: undefined | string): IterableIterator‹any›

Defined in parser/parser.ts:60

Parameters:

Name Type Default
file string -
sync? undefined | false | true -
type LookupType LookupType.Root
currentFile? undefined | string -

Returns: IterableIterator‹any›


parse

parse(html: string, filepath?: undefined | string): Template[]

Defined in parser/parser.ts:31

Parameters:

Name Type
html string
filepath? undefined | string

Returns: Template[]


parseStream

parseStream(tokens: TopLevelToken[]): ParseStreamHTMLToken | OutputToken | TagToken

Defined in parser/parser.ts:57

Parameters:

Name Type
tokens TopLevelToken[]

Returns: ParseStreamHTMLToken | OutputToken | TagToken


parseToken

parseToken(token: TopLevelToken, remainTokens: TopLevelToken[]): Tag | Output | HTML

Defined in parser/parser.ts:44

Parameters:

Name Type
token TopLevelToken
remainTokens TopLevelToken[]

Returns: Tag | Output | HTML


parseTokens

parseTokens(tokens: TopLevelToken[]): Template[]

Defined in parser/parser.ts:36

Parameters:

Name Type
tokens TopLevelToken[]

Returns: Template[]