UNPKG

@prism-lang/core

Version:

A programming language for uncertainty

80 lines 2.32 kB
import { Token } from './tokenizer'; import { Program } from './ast'; export declare class ParseError extends Error { token: Token; sourceCode?: string | undefined; constructor(message: string, token: Token, sourceCode?: string | undefined); private static formatError; } export declare class Parser { private tokens; private current; private sourceCode?; constructor(tokens: Token[], sourceCode?: string); parse(): Program; private statement; private agentsStatement; private agentDeclaration; private uncertainIfStatement; private ifStatement; private contextStatement; private blockStatement; private blockContents; private expressionStatement; private forStatement; private forInStatement; private whileStatement; private doWhileStatement; private breakStatement; private continueStatement; private uncertainForStatement; private uncertainWhileStatement; private parseUncertainBranches; private importStatement; private exportStatement; private functionDeclaration; private returnStatement; private variableDeclaration; private expression; private pipeline; private ternary; private confidenceExpression; private logicalOr; private nullishCoalesce; private confidenceCoalesce; private logicalAnd; private equality; private comparison; private term; private factor; private exponent; private unary; private call; private finishCall; private primary; private arrayLiteral; private objectLiteral; private match; private check; private advance; private isAtEnd; private peek; private peekNext; private previous; private consume; private synchronize; private parseInterpolatedString; private replacePlaceholders; private parsePattern; private tryParseDestructuringPattern; private isLikelyDestructuringPattern; private parseArrayPattern; private parseObjectPattern; private convertToPattern; private convertArrayToPattern; private convertObjectToPattern; private parseDestructuringArrayPattern; private parseDestructuringObjectPattern; } export declare function parse(source: string): Program; //# sourceMappingURL=parser.d.ts.map