Class: Parser

Hierarchy

  • Parser

Constructors

constructor

+ new Parser(liquid: Liquid): Parser

Defined in src/parser/parser.ts:22

Parameters:

Name Type
liquid Liquid

Returns: Parser

Properties

Private cache

cache: CacheThenableTemplate[]›› | undefined

Defined in src/parser/parser.ts:21


Private fs

fs: FS

Defined in src/parser/parser.ts:20


Private liquid

liquid: Liquid

Defined in src/parser/parser.ts:19


Private loader

loader: Loader

Defined in src/parser/parser.ts:22


parseFile

parseFile: function

Defined in src/parser/parser.ts:17

Type declaration:

▸ (file: string, sync?: undefined | false | true, type?: LookupType, currentFile?: undefined | string): Generator‹unknown, Template[], Template[] | string›

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): Generator‹unknown, Template[], string›

Defined in src/parser/parser.ts:77

Parameters:

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

Returns: Generator‹unknown, Template[], string›


Private _parseFileCached

_parseFileCached(file: string, sync?: undefined | false | true, type: LookupType, currentFile?: undefined | string): Generator‹unknown, Template[], Template[]›

Defined in src/parser/parser.ts:60

Parameters:

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

Returns: Generator‹unknown, Template[], Template[]›


parse

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

Defined in src/parser/parser.ts:31

Parameters:

Name Type
html string
filepath? undefined | string

Returns: Template[]


parseStream

parseStream(tokens: TopLevelToken[]): ParseStreamTopLevelToken

Defined in src/parser/parser.ts:57

Parameters:

Name Type
tokens TopLevelToken[]

Returns: ParseStreamTopLevelToken


parseToken

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

Defined in src/parser/parser.ts:44

Parameters:

Name Type
token TopLevelToken
remainTokens TopLevelToken[]

Returns: Tag‹› | Output‹› | HTML‹›


parseTokens

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

Defined in src/parser/parser.ts:36

Parameters:

Name Type
tokens TopLevelToken[]

Returns: Template[]