UNPKG

meld-spec

Version:

Specification for the Meld scripting language

24 lines (23 loc) 695 B
import { Parser } from '../types/parser'; import { MeldNode } from '../types/nodes'; /** * Mock parser implementation for testing * Returns a predefined set of nodes or throws errors based on test requirements */ export declare class MockParser implements Parser { private expectedNodes; private shouldThrow; private errorMessage; /** * Configure the mock parser to return specific nodes */ setExpectedNodes(nodes: MeldNode[]): void; /** * Configure the mock parser to throw an error */ setError(message: string): void; /** * Parse implementation that returns configured nodes or throws */ parse(input: string): MeldNode[]; }