UNPKG

2.93 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 readTagName(): string;
50 readHashes(jekyllStyle?: boolean): HashToken[];
51 readHash(jekyllStyle?: boolean): HashToken | undefined;
52 remaining(): string;
53 advance(i?: number): void;
54 end(): boolean;
55 readTo(end: string): number;
56 readValue(): ValueToken | undefined;
57 readRange(): RangeToken | undefined;
58 readValueOrThrow(): ValueToken;
59 readQuoted(): QuotedToken | undefined;
60 readFileNameTemplate(options: NormalizedFullOptions): IterableIterator<TopLevelToken>;
61 match(word: string): boolean;
62 rmatch(pattern: string): boolean;
63 peekType(n?: number): number;
64 peek(n?: number): string;
65 skipBlank(): void;
66}