UNPKG

harmonyc

Version:

Harmony Code - model-driven BDD for Vitest

19 lines (18 loc) 1.8 kB
import type { Parser, ParserOutput, Token } from 'typescript-parsec'; import { T } from './lexer.ts'; import { Action, Response, CodeLiteral, StringLiteral, Section, Step, Docstring, Word, Label, ErrorResponse, SetVariable, Switch } from '../model/model.ts'; export declare function parse(input: string): Section; export declare function parse<T>(input: string, production: Parser<any, T>): T; export declare const NEWLINES: Parser<T, Token<T>[]>, WORDS: Parser<T, Word>, DOUBLE_QUOTE_STRING: Parser<T, StringLiteral>, BACKTICK_STRING: Parser<T, CodeLiteral>, DOCSTRING: Parser<T, Docstring>, ERROR_MARK: Parser<T, Token<T>>, VARIABLE: Parser<T, string>, SIMPLE_PART: Parser<T, Word | StringLiteral | Docstring | CodeLiteral>, SWITCH: Parser<T, Switch>, BRACES: Parser<T, Switch>, PART: Parser<T, Word | Switch | StringLiteral | Docstring | CodeLiteral>, PHRASE: Parser<T, (Word | Switch | StringLiteral | Docstring | CodeLiteral)[]>, ARG: Parser<T, StringLiteral | Docstring | CodeLiteral>, SET_VARIABLE: Parser<T, SetVariable>, ACTION: Parser<T, Action | SetVariable>, RESPONSE: Parser<T, Response>, ERROR_RESPONSE: Parser<T, ErrorResponse>, SAVE_TO_VARIABLE: Parser<T, Response>, ARROW: Parser<T, Token<T>>, RESPONSE_ITEM: Parser<T, Response | ErrorResponse>, STEP: Parser<T, Step>, LABEL: Parser<T, Label>, SECTION: Parser<T, Section>, BRANCH: Parser<T, Section | Step>, // section first, to make sure there is no colon after step DENTS: Parser<T, { dent: number; isFork: boolean; }>, NODE: Parser<T, { dent: number; branch: Section | Step; }>, ANYTHING_BUT_NEWLINE: { parse(token: Token<T> | undefined): ParserOutput<T, Token<T>>; }, TEXT: Parser<T, undefined>, LINE: Parser<T, { dent: number; branch: Section | Step; } | undefined>, TEST_DESIGN: Parser<T, Section>;