import type { Backslash, ErrorMessage, Scanner } from "@ark/util"; import type { parseCharset } from "./charset.ts"; import type { parseEscape } from "./escape.ts"; import type { parseGroup } from "./group.ts"; import type { parseBuiltinQuantifier, parsePossibleRange, QuantifyingChar } from "./quantify.ts"; import type { Anchor, AnchorMarker, s, State, UnionTree } from "./state.ts"; export type parseState = s["unscanned"] extends ErrorMessage ? s["unscanned"] : s["unscanned"] extends "" ? s.finalize : parseState>; export type next = s["unscanned"] extends Scanner.shift ? lookahead extends "." ? s.shiftQuantifiable : lookahead extends Backslash ? parseEscape : lookahead extends "|" ? s.finalizeBranch : lookahead extends Anchor ? s.anchor, unscanned> : lookahead extends "(" ? parseGroup : lookahead extends ")" ? s.popGroup : lookahead extends QuantifyingChar ? parseBuiltinQuantifier : lookahead extends "{" ? parsePossibleRange : lookahead extends "[" ? parseCharset : s.shiftQuantifiable, unscanned> : never; type maybeSplitCasing = caseInsensitive extends false ? char : Lowercase extends Uppercase ? char : UnionTree<[Lowercase, Capitalize]>; export {};