Skip to main content

Crate sim_lib_pattern

Crate sim_lib_pattern 

Source
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 Shape that matches any TaggedValue of a given ADT.
AlgebraicDataType
A tagged-union type: a named set of variants, each with its own fields.
AssertionId
Stable identifier for a named assertion definition.
AssertionProgram
A separately compiled lookahead whose width is known before execution.
Automaton
A compiled, explicitly branching tagged automaton.
ByteDomain
A domain whose symbols and offsets are bytes.
ByteOffset
A byte offset.
CaptureId
Stable identifier for a tagged capture.
CaptureSpan
One completed tagged capture, expressed in subject-symbol offsets.
CodeUnitDomain
A domain whose symbols and offsets are exact UTF-16 code units.
CodeUnitOffset
Checked exact-text offset types owned by sim-text. An offset in the exact UTF-16 code-unit sequence.
CompilationEvidence
Browsable facts about a compilation.
Cursor
A matching cursor carrying independent source and subject positions.
DomainCaptureSpan
A half-open capture span whose offset type identifies its subject domain.
DomainMatch
A successful match whose offsets cannot be mixed with another domain.
EnginePolicy
Target-engine policy for dialect extension nodes.
ExecutionMatch
A successful regular-engine match.
ExecutionReceipt
Exact work consumed by an execution attempt.
ExtensionLimits
Independent limits for work that can invalidate regular worst-case bounds.
ExtensionReceipt
Exact non-regular work charged by an attempt.
ExtensionWork
One unit placed onto the bounded extension queue.
GlobPatternDialect
Compiler for small shell-style glob patterns.
LuaPatternDialect
Compiler for Lua-style text patterns.
MatchArm
One arm of a match: a labelled pattern Shape plus optional coverage info.
MatchForm
The match special form: (match scrutinee (pattern body...) ...).
PatternField
A named field of an ADT variant, carrying the kernel Shape that checks and binds its value.
PatternIr
A fully validated pattern IR tied to one symbol and offset domain.
PatternLib
The pattern organ lib: installs the pattern special forms as callables.
PatternMatch
The outcome of a successful match_value: which arm fired, its bindings, and the match score.
RepeatBounds
Valid bounds for a repetition node.
ScalarDomain
A domain whose symbols and offsets are Unicode scalar values.
ScalarOffset
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.
TaggedValue
A constructed ADT value: an ADT name, a variant tag, and named field values.
TextLimits
Step limits for the bounded VM.
TextMatch
A successful text-pattern match.
VariantConstructor
A callable builder for one ADT variant.
VariantDeclaration
One named variant of an AlgebraicDataType, with its ordered fields.
VariantShape
A kernel Shape that matches one specific ADT variant by tag and fields.

Enums§

Anchor
A zero-width subject anchor.
DomainExecutionOutcome
A resource-accounted execution result with domain-typed match positions.
ExecutionLimit
The resource whose configured limit stopped execution.
ExecutionOutcome
A typed execution result. Resource exhaustion is never collapsed into rejection.
ExtensionKind
Stable kinds understood by the non-regular extension lane.
ExtensionOutcome
Result of a bounded non-regular attempt.
ExtensionRefusal
Typed reason that extension execution did not produce a match decision.
ExtensionStep
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.
TextClass
Character class understood by the shared text-pattern VM.
TextOp
One operation in the shared text-pattern VM.
UnsupportedFeature
A pattern feature deliberately excluded from the regular executor.

Statics§

RECIPES
Cookbook recipes for this lib, embedded at build time.

Traits§

BoundedExtension
Opt-in implementation of one non-regular feature family.
PatternDialect
A surface pattern syntax that compiles to the shared text-pattern VM.
SymbolDomain
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 expr against a single shape, returning the kernel ShapeMatch.
destructure_value
Checks value against a single shape, returning the kernel ShapeMatch.
execute_bytes
Execute a byte-domain automaton over exact bytes.
execute_code_units
Execute a code-unit-domain automaton over an exact sim-text value.
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 adt variants not covered by arms.
install_pattern_lib
Installs the pattern organ into cx (idempotent).
manifest_name
Returns the sim/pattern manifest id under which this lib registers.
match_value
Matches value against arms in 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 subject starting at byte offset init.
tagged_value
Downcasts a runtime Value to a TaggedValue, if it is one.