UNPKG

2.9 kBTypeScriptView Raw
1import { IdentifierToken } from '../tokens/identifier-token';
2import { OperatorToken } from '../tokens/operator-token';
3import { TopLevelToken } from '../tokens/toplevel-token';
4import { FilterArg } from './filter-arg';
5import { FilterToken } from '../tokens/filter-token';
6import { HashToken } from '../tokens/hash-token';
7import { QuotedToken } from '../tokens/quoted-token';
8import { HTMLToken } from '../tokens/html-token';
9import { TagToken } from '../tokens/tag-token';
10import { Token } from '../tokens/token';
11import { RangeToken } from '../tokens/range-token';
12import { ValueToken } from '../tokens/value-token';
13import { OutputToken } from '../tokens/output-token';
14import { TokenizationError } from '../util/error';
15import { NormalizedFullOptions } from '../liquid-options';
16import { Trie } from '../util/operator-trie';
17import { Expression } from '../render/expression';
18import { LiquidTagToken } from '../tokens/liquid-tag-token';
19export declare class Tokenizer {
20 input: string;
21 private trie;
22 file: string;
23 p: number;
24 N: number;
25 private rawBeginAt;
26 constructor(input: string, trie: Trie, file?: string);
27 readExpression(): Expression;
28 readExpressionTokens(): IterableIterator<Token>;
29 readOperator(): OperatorToken | undefined;
30 readFilters(): FilterToken[];
31 readFilter(): FilterToken | null;
32 readFilterArg(): FilterArg | undefined;
33 readTopLevelTokens(options?: NormalizedFullOptions): TopLevelToken[];
34 readTopLevelToken(options: NormalizedFullOptions): TopLevelToken;
35 readHTMLToken(stopStrings: string[]): HTMLToken;
36 readTagToken(options?: NormalizedFullOptions): TagToken;
37 readToDelimiter(delimiter: string): number;
38 readOutputToken(options?: NormalizedFullOptions): OutputToken;
39 readEndrawOrRawContent(options: NormalizedFullOptions): HTMLToken | TagToken;
40 readLiquidTagTokens(options?: NormalizedFullOptions): LiquidTagToken[];
41 readLiquidTagToken(options: NormalizedFullOptions): LiquidTagToken;
42 mkError(msg: string, begin: number): TokenizationError;
43 snapshot(begin?: number): string;
44 /**
45 * @deprecated
46 */
47 readWord(): IdentifierToken;
48 readIdentifier(): IdentifierToken;
49 readHashes(jekyllStyle?: boolean): HashToken[];
50 readHash(jekyllStyle?: boolean): HashToken | undefined;
51 remaining(): string;
52 advance(i?: number): void;
53 end(): boolean;
54 readTo(end: string): number;
55 readValue(): ValueToken | undefined;
56 readRange(): RangeToken | undefined;
57 readValueOrThrow(): ValueToken;
58 readQuoted(): QuotedToken | undefined;
59 readFileNameTemplate(options: NormalizedFullOptions): IterableIterator<TopLevelToken>;
60 match(word: string): boolean;
61 rmatch(pattern: string): boolean;
62 peekType(n?: number): number;
63 peek(n?: number): string;
64 skipBlank(): void;
65}