UNPKG

@thi.ng/parse

Version:

Purely functional parser combinators & AST generation for generic inputs

22 lines (21 loc) 479 B
import { WS as _WS } from "@thi.ng/strings/groups"; import { oneOrMoreD, zeroOrMoreD } from "../combinators/repeat.js"; import { oneOf, oneOfD } from "../prims/one-of.js"; const WS = oneOfD(_WS); const SPACE = oneOfD(" "); const NL = oneOf("\n\r"); const DNL = oneOfD("\n\r"); const WS0 = zeroOrMoreD(WS); const WS1 = oneOrMoreD(WS); const SPACES0 = zeroOrMoreD(SPACE); const SPACES = oneOrMoreD(SPACE); export { DNL, NL, SPACE, SPACES, SPACES0, WS, WS0, WS1 };