/** * Expr-lang recursive descent parser * Ported from Go's expr-lang parser with precedence climbing algorithm */ import { ParseError } from './types'; export declare class ExprParser { private lexer; private current; private errors; constructor(); /** * Parse an expr-lang expression and return any syntax errors. * Returns empty array if the expression is valid. */ parse(input: string): ParseError[]; private advance; private curKind; private curVal; private expect; private error; private errorAt; /** * parseSequenceExpression parses multiple expressions separated by semicolons. */ private parseSequenceExpression; /** * parseExpression uses precedence climbing to parse binary expressions. */ private parseExpression; /** * parsePrimary handles unary operators, parentheses, and the #/. pointer prefix. */ private parsePrimary; /** * parseSecondary handles identifiers, literals, arrays, and maps. */ private parseSecondary; /** * parsePostfixExpression handles .member, ?.member, [index], [from:to], and calls after the primary. */ private parsePostfixExpression; /** * parseVariableDeclaration parses "let name = value; rest" */ private parseVariableDeclaration; /** * parseConditionalIf parses "if expr { expr1 } else { expr2 }" or "if expr { expr1 } else if ..." */ private parseConditionalIf; /** * parseConditional parses "expr ? expr1 : expr2" or "expr ?: expr2" */ private parseConditional; /** * parseArguments parses function call arguments: (arg1, arg2, ...) */ private parseArguments; /** * parseArrayExpression parses "[elem1, elem2, ...]" */ private parseArrayExpression; /** * parseMapExpression parses "{key: value, ...}" */ private parseMapExpression; }