Expand description
Pattern behavior for the SIM runtime over the kernel Shape protocol.
The kernel defines the Shape match/binding protocol; this crate supplies
the concrete pattern organ (algebraic data types, destructuring, match arms,
and exhaustiveness checking) as pattern surfaces over that protocol.
Structs§
- AdtShape
- A kernel
Shapethat matches anyTaggedValueof a given ADT. - Algebraic
Data Type - A tagged-union type: a named set of variants, each with its own fields.
- Assertion
Id - Stable identifier for a named assertion definition.
- Assertion
Program - A separately compiled lookahead whose width is known before execution.
- Automaton
- A compiled, explicitly branching tagged automaton.
- Byte
Domain - A domain whose symbols and offsets are bytes.
- Byte
Offset - A byte offset.
- Capture
Id - Stable identifier for a tagged capture.
- Capture
Span - One completed tagged capture, expressed in subject-symbol offsets.
- Code
Unit Domain - A domain whose symbols and offsets are exact UTF-16 code units.
- Code
Unit Offset - Checked exact-text offset types owned by
sim-text. An offset in the exact UTF-16 code-unit sequence. - Compilation
Evidence - Browsable facts about a compilation.
- Cursor
- A matching cursor carrying independent source and subject positions.
- Domain
Capture Span - A half-open capture span whose offset type identifies its subject domain.
- Domain
Match - A successful match whose offsets cannot be mixed with another domain.
- Engine
Policy - Target-engine policy for dialect extension nodes.
- Execution
Match - A successful regular-engine match.
- Execution
Receipt - Exact work consumed by an execution attempt.
- Extension
Limits - Independent limits for work that can invalidate regular worst-case bounds.
- Extension
Receipt - Exact non-regular work charged by an attempt.
- Extension
Work - One unit placed onto the bounded extension queue.
- Glob
Pattern Dialect - Compiler for small shell-style glob patterns.
- LuaPattern
Dialect - Compiler for Lua-style text patterns.
- Match
Arm - One arm of a match: a labelled pattern
Shapeplus optional coverage info. - Match
Form - The
matchspecial form:(match scrutinee (pattern body...) ...). - Pattern
Field - A named field of an ADT variant, carrying the kernel
Shapethat checks and binds its value. - Pattern
Ir - A fully validated pattern IR tied to one symbol and offset domain.
- Pattern
Lib - The pattern organ lib: installs the pattern special forms as callables.
- Pattern
Match - The outcome of a successful
match_value: which arm fired, its bindings, and the match score. - Repeat
Bounds - Valid bounds for a repetition node.
- Scalar
Domain - A domain whose symbols and offsets are Unicode scalar values.
- Scalar
Offset - Checked exact-text offset types owned by
sim-text. An offset in the Unicode scalar sequence. - State
- One stable state in a compiled automaton.
- StateId
- Stable identifier of an automaton state.
- Tagged
Value - A constructed ADT value: an ADT name, a variant tag, and named field values.
- Text
Limits - Step limits for the bounded VM.
- Text
Match - A successful text-pattern match.
- Variant
Constructor - A callable builder for one ADT variant.
- Variant
Declaration - One named variant of an
AlgebraicDataType, with its ordered fields. - Variant
Shape - A kernel
Shapethat matches one specific ADT variant by tag and fields.
Enums§
- Anchor
- A zero-width subject anchor.
- Domain
Execution Outcome - A resource-accounted execution result with domain-typed match positions.
- Execution
Limit - The resource whose configured limit stopped execution.
- Execution
Outcome - A typed execution result. Resource exhaustion is never collapsed into rejection.
- Extension
Kind - Stable kinds understood by the non-regular extension lane.
- Extension
Outcome - Result of a bounded non-regular attempt.
- Extension
Refusal - Typed reason that extension execution did not produce a match decision.
- Extension
Step - Result of evaluating one queue item without recursive calls.
- Instruction
- The action performed by one automaton state.
- IrError
- A construction failure for pattern IR.
- IrNode
- One structured pattern expression.
- TagBoundary
- A capture-tag boundary.
- Text
Class - Character class understood by the shared text-pattern VM.
- TextOp
- One operation in the shared text-pattern VM.
- Unsupported
Feature - A pattern feature deliberately excluded from the regular executor.
Statics§
- RECIPES
- Cookbook recipes for this lib, embedded at build time.
Traits§
- Bounded
Extension - Opt-in implementation of one non-regular feature family.
- Pattern
Dialect - A surface pattern syntax that compiles to the shared text-pattern VM.
- Symbol
Domain - A symbol domain defines both the unit consumed by a pattern and its offset type.
Functions§
- compile
- Compile validated IR into a stable tagged Thompson graph.
- compile_
glob_ pattern - Compiles a shell-style glob into shared VM operations.
- compile_
lua_ pattern - Compiles a Lua-style text pattern into shared VM operations.
- destructure_
expr - Checks
expragainst a singleshape, returning the kernelShapeMatch. - destructure_
value - Checks
valueagainst a singleshape, returning the kernelShapeMatch. - execute_
bytes - Execute a byte-domain automaton over exact bytes.
- execute_
code_ units - Execute a code-unit-domain automaton over an exact
sim-textvalue. - execute_
extension - Executes an admitted non-regular operation using an independent FIFO budget.
- execute_
regular - Executes a compiled regular automaton without recursion or backtracking.
- execute_
scalars - Execute a scalar-domain automaton over Unicode scalar values.
- exhaustiveness_
diagnostics - Returns diagnostics for any
adtvariants not covered byarms. - install_
pattern_ lib - Installs the pattern organ into
cx(idempotent). - manifest_
name - Returns the
sim/patternmanifest id under which this lib registers. - match_
value - Matches
valueagainstarmsin order, returning the first that accepts. - pattern_
adt_ op_ key - Returns the operation key for declaring an ADT.
- pattern_
declared_ op_ keys - Returns every pattern-surface operation this crate models, whether or not it is currently exported as a live runtime callable.
- pattern_
destructure_ op_ key - Returns the operation key for destructuring a value or expression.
- pattern_
exhaustive_ op_ key - Returns the operation key for exhaustiveness checking.
- pattern_
exports - Returns the lib’s exported pattern forms as kernel
Exports. - pattern_
live_ ops - Live pattern claim-to-export mappings backed by the loaded runtime surface.
- pattern_
match_ op_ key - Returns the operation key for matching a value against pattern arms.
- pattern_
op_ keys - Returns the operation keys the pattern organ currently publishes as live claims.
- pattern_
organ_ symbol - Returns the organ symbol that identifies the pattern surface.
- pattern_
tag_ op_ key - Returns the operation key for constructing a tagged value.
- publish_
pattern_ organ_ claims - Publishes the pattern organ and its operation keys as kernel claims.
- publish_
pattern_ organ_ claims_ for_ lib - Publishes pattern organ claims as part of a loaded lib receipt.
- require_
code_ unit_ offset - Type-checking witness used by APIs that require an exact code-unit offset.
- run_
text_ pattern - Runs a compiled text pattern over
subjectstarting at byte offsetinit. - tagged_
value - Downcasts a runtime
Valueto aTaggedValue, if it is one.