SKalt / brzozowski-ts

Typescript compile-time recognition of regular languages
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

[Feature]: support regex alternation `/a|b/` #1

Closed SKalt closed 1 week ago

SKalt commented 1 month ago

Rationale

Extends ECMAScript Regular expression support

Actual behavior

import { RecognizePattern } from "."
import { Eq } from "./utils"
const topLevelAlternationAOk = Eq<RecognizePattern<"a|b", "a">, "a"> = true
const topLevelAlternationBOk = Eq<RecognizePattern<"a|b", "b">, "b"> = true