import { Token } from './ast'; /** * Tokenize template string into AST nodes (with caching) * Supports: * - {expression} - Variable interpolation, function calls, member access * - {if condition}...{elseif condition}...{else}...{/if} - Conditional blocks with multiple branches * - {for item in list}...{/for} - Loop blocks for array iteration * - {while condition}...{/while} - While loop blocks (boolean condition only) * - {repeat count}...{/repeat} - Repeat blocks for count-based iteration * - {{ - Escape sequence for literal { character * - }} - Escape sequence for literal } character */ export declare function tokenize(input: string): Token[]; /** * Clear tokenize cache (useful for testing or memory management) */ export declare function clearTokenizeCache(): void; /** * Template lexer token types */ export type TemplateLexerToken = { type: 'text'; value: string; } | { type: 'tag'; content: string; }; /** * Expression lexer token types */ export type ExpressionToken = { type: 'number'; value: number; } | { type: 'string'; value: string; } | { type: 'identifier'; name: string; } | { type: 'keyword'; value: 'true' | 'false' | 'null'; } | { type: 'operator'; value: string; } | { type: 'punctuation'; value: '(' | ')' | '[' | ']' | '.' | ',' | '?' | ':'; } | { type: 'eof'; }; /** * Expression Lexer: Tokenizes expression strings * Used by ExpressionParser for parsing expressions */ export declare class ExpressionLexer { private input; private pos; constructor(input: string); tokenize(): ExpressionToken[]; private scanToken; private scanStringLiteral; private scanNumberLiteral; private scanIdentifierOrKeyword; private peek; private advance; private skipWhitespace; private isAtEnd; private isDigit; private isIdentifierStart; private isIdentifierPart; }