1 | import { FilteredValueToken, TagToken, HTMLToken, HashToken, QuotedToken, LiquidTagToken, OutputToken, ValueToken, Token, RangeToken, FilterToken, TopLevelToken, OperatorToken, LiteralToken, IdentifierToken, NumberToken } from '../tokens';
|
2 | import { Trie, TokenizationError } from '../util';
|
3 | import { Operators, Expression } from '../render';
|
4 | import { NormalizedFullOptions } from '../liquid-options';
|
5 | import { FilterArg } from './filter-arg';
|
6 | export declare class Tokenizer {
|
7 | input: string;
|
8 | file?: string | undefined;
|
9 | p: number;
|
10 | N: number;
|
11 | private rawBeginAt;
|
12 | private opTrie;
|
13 | private literalTrie;
|
14 | constructor(input: string, operators?: Operators, file?: string | undefined, range?: [number, number]);
|
15 | readExpression(): Expression;
|
16 | readExpressionTokens(): IterableIterator<Token>;
|
17 | readOperator(): OperatorToken | undefined;
|
18 | matchTrie<T>(trie: Trie<T>): number;
|
19 | readFilteredValue(): FilteredValueToken;
|
20 | readFilters(): FilterToken[];
|
21 | readFilter(): FilterToken | null;
|
22 | readFilterArg(): FilterArg | undefined;
|
23 | readTopLevelTokens(options?: NormalizedFullOptions): TopLevelToken[];
|
24 | readTopLevelToken(options: NormalizedFullOptions): TopLevelToken;
|
25 | readHTMLToken(stopStrings: string[]): HTMLToken;
|
26 | readTagToken(options: NormalizedFullOptions): TagToken;
|
27 | readToDelimiter(delimiter: string, respectQuoted?: boolean): number;
|
28 | readOutputToken(options?: NormalizedFullOptions): OutputToken;
|
29 | readEndrawOrRawContent(options: NormalizedFullOptions): HTMLToken | TagToken;
|
30 | readLiquidTagTokens(options?: NormalizedFullOptions): LiquidTagToken[];
|
31 | readLiquidTagToken(options: NormalizedFullOptions): LiquidTagToken | undefined;
|
32 | error(msg: string, pos?: number): TokenizationError;
|
33 | assert(pred: unknown, msg: string | (() => string), pos?: number): void;
|
34 | snapshot(begin?: number): string;
|
35 | /**
|
36 | * @deprecated use #readIdentifier instead
|
37 | */
|
38 | readWord(): IdentifierToken;
|
39 | readIdentifier(): IdentifierToken;
|
40 | readNonEmptyIdentifier(): IdentifierToken | undefined;
|
41 | readTagName(): string;
|
42 | readHashes(jekyllStyle?: boolean | string): HashToken[];
|
43 | readHash(jekyllStyle?: boolean | string): HashToken | undefined;
|
44 | remaining(): string;
|
45 | advance(step?: number): void;
|
46 | end(): boolean;
|
47 | readTo(end: string): number;
|
48 | readValue(): ValueToken | undefined;
|
49 | readScopeValue(): ValueToken | undefined;
|
50 | private readProperties;
|
51 | readNumber(): NumberToken | undefined;
|
52 | readLiteral(): LiteralToken | undefined;
|
53 | readRange(): RangeToken | undefined;
|
54 | readValueOrThrow(): ValueToken;
|
55 | readQuoted(): QuotedToken | undefined;
|
56 | readFileNameTemplate(options: NormalizedFullOptions): IterableIterator<TopLevelToken>;
|
57 | match(word: string): boolean;
|
58 | rmatch(pattern: string): boolean;
|
59 | peekType(n?: number): number;
|
60 | peek(n?: number): string;
|
61 | skipBlank(): void;
|
62 | }
|