UNPKG

functionalscript

Version:

FunctionalScript is a purely functional subset of JavaScript

14 lines (13 loc) 590 B
import { type List } from '../types/list/module.f.ts'; import { type ByteSet } from '../types/byte_set/module.f.ts'; import { type RangeMapArray } from '../types/range_map/module.f.ts'; type Rule = readonly [string, ByteSet, string]; export type Grammar = List<Rule>; type Dfa = { readonly [state in string]: RangeMapArray<string>; }; export declare const toRange: (s: string) => ByteSet; export declare const toUnion: (s: string) => ByteSet; export declare const dfa: (grammar: Grammar) => Dfa; export declare const run: (dfa: Dfa) => (input: List<number>) => List<string>; export {};