Skip to main content

Module parser

Module parser 

Source
Expand description

XSD §F regex parser — XSD-flavour source → Expr AST.

Implements the BNF from XSD Part 2 §F: regExp is a branch list joined by |; each branch is a sequence of pieces; each piece is an atom with an optional quantifier. Atoms are single characters, escapes, character classes, or parenthesised regexps.

Pre-translation rejects constructs XSD §F forbids: back-references, lookaround, inline modifiers, anchor escapes. These errors fire at schema compile time so users get a single clear diagnostic up front instead of a confusing deferred-compile failure at first match.

Enums§

AnchorKind
Position-anchor variety used by Expr::Anchor.
Dialect
Source-level dialect. XSD §F.1 forbids ^ and $ (patterns are implicitly whole-input anchored); XPath 2.0 §7.6 keeps the XSD grammar but adds them back as explicit anchors usable anywhere in the pattern.
Expr
Parsed XSD regex. Classes are flattened to [ClassSet] at parse time so the NFA builder doesn’t need to know about \p{...}, \d, class subtraction, etc.

Functions§

parse
Parse XSD §F source into an Expr.
parse_with
Parse with a specific source dialect. See Dialect.