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.
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.
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.
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§

TextClass
Character class understood by the shared text-pattern VM.
TextOp
One operation in the shared text-pattern VM.

Statics§

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

Traits§

PatternDialect
A surface pattern syntax that compiles to the shared text-pattern VM.

Functions§

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.
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.
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.