UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

16 lines (15 loc) 707 B
import { type Token } from 'acorn'; import type es from 'estree'; import { Chapter, type Context, Variant } from '../../types'; import type { AcornOptions, Parser } from '../types'; export declare class SourceParser implements Parser<AcornOptions> { private chapter; private variant; constructor(chapter: Chapter, variant: Variant); static tokenize(programStr: string, context: Context): Token[]; parse(programStr: string, context: Context, options?: Partial<AcornOptions>, throwOnError?: boolean): es.Program | null; validate(ast: es.Program, context: Context, throwOnError?: boolean): boolean; toString(): string; private getDisallowedSyntaxes; private getLangRules; }