UNPKG

parseit.js

Version:

Customizable parsing library for converting a list of tokens into an AST tree

16 lines (15 loc) 443 B
import Token from "./Token"; export declare enum ParseErrorType { UNEXP_TOKEN = 0 } export declare type ParseErrorPosition = { index: number; token: Token | null; }; export default class ParseError { type: ParseErrorType; position: ParseErrorPosition; constructor(index: number, token: Token, type?: ParseErrorType); toString: () => string; } export declare function error(index: number, token: Token): ParseError;