/** * The expression grammar between a primary and a statement: precedence * climbing over the binary operators, the comparison chain, `not`/`-`/`await` * and the other prefixes, `**`, the conditional forms, and arrow functions — * including the two lookaheads that tell an arrow's parameter list from a * parenthesized expression and an arrow's `{` from a record literal. */ import type { Expression, Parameter, TypeReference } from "../../ast.ts"; import { type Diagnostic } from "../../diagnostic.ts"; import { type Token, type TokenKind } from "../../token.ts"; export interface OperatorParserHost { advance(): Token; check(kind: TokenKind): boolean; contextualParameterDepth: number; current(): Token; readonly diagnostics: Diagnostic[]; expect(kind: TokenKind, message: string): Token; index: number; match(kind: TokenKind): boolean; parseExpression(minimumPrecedence?: number): Expression; parseParameters(): readonly Parameter[]; parsePostfix(): Expression; parseTypeReference(allowTrailingOptional?: boolean, initialized?: boolean): TypeReference; peekKind(distance: number): TokenKind; previous(): Token; recoverExpressionAssignment(expression: Expression): Expression; reportPrefixBang(bang: Token): void; readonly tokens: Token[]; withParseDepth(parse: () => T): T; } export declare class OperatorParser { private readonly host; constructor(host: OperatorParserHost); parseExpressionBody(minimumPrecedence?: number): Expression; private hasPythonConditionalElse; /** * A comparison chain: `a < b < c` is one expression with three operands, not * two nested binaries, so the whole run of comparison operators is read here * and collapses back to a plain `BinaryExpression` when only one was written. */ private parseComparisonChain; /** * A type test: `value is Type`, `value is not Type`, and the JavaScript * `instanceof` spelling recovered as the `is` it meant. */ private parseTypeTest; private parseArrowExpression; private parseArrowBody; private arrowBraceHoldsStatements; private isParenthesizedArrow; private parseUnary; private parsePower; private parsePowerBase; private binaryOperator; private isUnparenthesizedComparisonLayer; private isMembershipOrTypeTest; private checkNullishBooleanMixing; private questionContinuesExpression; private typeTestHasConditionalQuestion; } //# sourceMappingURL=operators.d.ts.map