Sign in

    moonrockz/diagrams/regex does not have a README file

    AnchorKind

    pub(all) enum AnchorKind {
    LineStart
    LineEnd
    InputStart
    InputEndBeforeNewline
    InputEnd
    PreviousMatchEnd
    WordBoundary
    NonWordBoundary
    } derive(Eq,
    Debug
    )

    A zero-width position test that consumes no input.

    AnchorKind::equal

    fn AnchorKind::equal(AnchorKind, AnchorKind) -> Bool

    AnchorKind::not_equal

    fn AnchorKind::not_equal(x : AnchorKind, y : AnchorKind) -> Bool

    Bounds

    pub struct Bounds {
    min : Int
    max : Int?
    reluctant : Bool
    spelling : String
    } derive(Eq,
    Debug
    )

    Symbolic repetition bounds. A repeat is never expanded into copies.

    Bounds::equal

    fn Bounds::equal(Bounds, Bounds) -> Bool

    Bounds::new

    fn Bounds::new(min : Int, max? : Int, reluctant? : Bool, spelling? : String) -> Bounds

    Make bounds. The spelling defaults to the canonical regex quantifier.

    Bounds::not_equal

    fn Bounds::not_equal(x : Bounds, y : Bounds) -> Bool

    Bounds::to_repr

    ClassKind

    pub(all) enum ClassKind {
    Any
    Shorthand(Char)
    Property(String)
    CodePoint(String)
    Posix(String)
    } derive(Eq,
    Debug
    )

    A predefined character class. The spelling is kept for display.

    ClassKind::equal

    fn ClassKind::equal(ClassKind, ClassKind) -> Bool

    ClassKind::not_equal

    fn ClassKind::not_equal(x : ClassKind, y : ClassKind) -> Bool

    GroupKind

    pub(all) enum GroupKind {
    Capturing
    NonCapturing
    Named(String)
    } derive(Eq,
    Debug
    )

    GroupKind::equal

    fn GroupKind::equal(GroupKind, GroupKind) -> Bool

    GroupKind::not_equal

    fn GroupKind::not_equal(x : GroupKind, y : GroupKind) -> Bool

    Index

    pub struct Index {
    regex : Regex
    order : ReadOnlyArray[String]
    // private fields
    }

    A validated view of a regex model with constant-time lookups. Every node except the root has exactly one parent, so the arena is a finite tree.

    Index::build

    fn Index::build(regex : Regex, limits? : Limits) -> IndexResult

    Validate identities, ownership, bounds and explicit limits without recursion.

    Index::depth

    fn Index::depth(self : Index, id : String) -> Int?

    Index::node

    fn Index::node(self : Index, id : String) -> Node?

    Index::parent

    fn Index::parent(self : Index, id : String) -> String?

    IndexResult

    pub struct IndexResult {
    index : Index?
    diagnostics : ReadOnlyArray[
    Diagnostic
    ]
    }

    Kind

    pub(all) enum Kind {
    Literal(String)
    Class(ClassKind)
    Set(Bool, ReadOnlyArray[SetItem])
    Anchor(AnchorKind)
    Backreference(String)
    Sequence(ReadOnlyArray[String])
    Choice(ReadOnlyArray[String])
    Group(GroupKind, String)
    Repeat(Bounds, String)
    Assertion(Look, Bool, String)
    } derive(Eq,
    Debug
    )

    The meaning of one expression node. Composite kinds name their children by node identity, so a model is a flat, bounded arena.

    Kind::equal

    fn Kind::equal(Kind, Kind) -> Bool

    Kind::not_equal

    fn Kind::not_equal(x : Kind, y : Kind) -> Bool

    Kind::to_repr

    Limits

    pub struct Limits {
    nodes : Int
    depth : Int
    work : Int
    } derive(Eq,
    Debug
    )

    Explicit bounds for model validation and indexing.

    Limits::equal

    fn Limits::equal(Limits, Limits) -> Bool

    Limits::new

    fn Limits::new(nodes? : Int, depth? : Int, work? : Int) -> Limits

    Limits::not_equal

    fn Limits::not_equal(x : Limits, y : Limits) -> Bool

    Limits::to_repr

    Look

    pub(all) enum Look {
    Ahead
    Behind
    } derive(Eq,
    Debug
    )

    The direction of a lookaround assertion.

    Look::equal

    fn Look::equal(Look, Look) -> Bool

    Look::not_equal

    fn Look::not_equal(x : Look, y : Look) -> Bool

    Look::to_repr

    Node

    pub struct Node {
    id : String
    kind : Kind
    source :
    Span
    ?
    } derive(Eq,
    Debug
    )

    Node::children

    fn Node::children(self : Node) -> ReadOnlyArray[String]

    The children of node in drawing order.

    Node::equal

    fn Node::equal(Node, Node) -> Bool

    Node::is_leaf

    fn Node::is_leaf(self : Node) -> Bool

    Literal text, classes, sets and anchors are leaves of the railroad.

    Node::label

    fn Node::label(self : Node) -> String

    The visible label of a leaf, or the name of a composite construct.

    Node::new

    fn Node::new(id : String, kind : Kind, source? :
    Span
    ) -> Node

    Node::not_equal

    fn Node::not_equal(x : Node, y : Node) -> Bool

    Node::to_repr

    Regex

    pub struct Regex {
    id : String
    root : String
    nodes : ReadOnlyArray[Node]
    title : String?
    accessibility_title : String?
    accessibility_description : String?
    pattern : String?
    } derive(Eq,
    Debug
    )

    One immutable regular-expression diagram. It describes the structure of a pattern; it does not match input.

    Regex::equal

    fn Regex::equal(Regex, Regex) -> Bool

    Regex::new

    fn Regex::new(id : String, root : String, nodes : ArrayView[Node], title? : String, accessibility_title? : String, accessibility_description? : String, pattern? : String) -> Regex

    Make a regex model. pattern is the optional source spelling for display.

    Regex::node

    fn Regex::node(self : Regex, id : String) -> Node?

    Find a node by identity. The search is linear; use Index for repeated lookups.

    Regex::not_equal

    fn Regex::not_equal(x : Regex, y : Regex) -> Bool

    Regex::to_repr

    SetItem

    pub(all) enum SetItem {
    Char(String)
    Range(String, String)
    Escape(String)
    } derive(Eq,
    Debug
    )

    One item of a bracketed character set.

    SetItem::equal

    fn SetItem::equal(SetItem, SetItem) -> Bool

    SetItem::not_equal

    fn SetItem::not_equal(x : SetItem, y : SetItem) -> Bool

    SetItem::to_repr

    diagnostic_codes

    let diagnostic_codes : ReadOnlyArray[String]

    The stable diagnostic codes of model validation.

    validate

    fn validate(regex : Regex, limits? : Limits) -> ReadOnlyArray[
    Diagnostic
    ]

    Validate a constructed model. An empty result means the model is valid.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io