sim-lib-pattern 0.2.0

Shape-based pattern matching and destructuring for SIM runtime values.
Documentation
#![forbid(unsafe_code)]
#![deny(missing_docs)]
//! 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.

mod adt;
mod claims;
mod compile;
mod cursor;
mod dialect;
mod domain_execute;
mod execute;
mod extension;
mod glob_dialect;
mod ir;
mod lua_dialect;
mod match_form;
mod matching;
mod runtime;
mod shapes;
mod text_vm;

pub use adt::{
    AlgebraicDataType, PatternField, TaggedValue, VariantConstructor, VariantDeclaration,
    tagged_value,
};
pub use claims::{
    pattern_adt_op_key, pattern_declared_op_keys, pattern_destructure_op_key,
    pattern_exhaustive_op_key, pattern_live_ops, pattern_match_op_key, pattern_op_keys,
    pattern_organ_symbol, pattern_tag_op_key, publish_pattern_organ_claims,
    publish_pattern_organ_claims_for_lib,
};
pub use compile::{
    AssertionProgram, Automaton, CompilationEvidence, Instruction, State, StateId, TagBoundary,
    compile,
};
pub use cursor::{
    ByteDomain, ByteOffset, CodeUnitDomain, CodeUnitOffset, Cursor, ScalarDomain, ScalarOffset,
    SymbolDomain,
};
pub use dialect::PatternDialect;
pub use domain_execute::{
    DomainCaptureSpan, DomainExecutionOutcome, DomainMatch, execute_bytes, execute_code_units,
    execute_scalars, require_code_unit_offset,
};
pub use execute::{
    CaptureSpan, ExecutionLimit, ExecutionMatch, ExecutionOutcome, ExecutionReceipt,
    UnsupportedFeature, execute_regular,
};
pub use extension::{
    BoundedExtension, ExtensionKind, ExtensionLimits, ExtensionOutcome, ExtensionReceipt,
    ExtensionRefusal, ExtensionStep, ExtensionWork, execute_extension,
};
pub use glob_dialect::{GlobPatternDialect, compile_glob_pattern};
pub use ir::{
    Anchor, AssertionId, CaptureId, EnginePolicy, IrError, IrNode, PatternIr, RepeatBounds,
};
pub use lua_dialect::{LuaPatternDialect, compile_lua_pattern};
pub use match_form::MatchForm;
pub use matching::{
    MatchArm, PatternMatch, destructure_expr, destructure_value, exhaustiveness_diagnostics,
    match_value,
};
pub use runtime::{PatternLib, install_pattern_lib, manifest_name, pattern_exports};
pub use shapes::{AdtShape, VariantShape};
pub use text_vm::{TextClass, TextLimits, TextMatch, TextOp, run_text_pattern};

/// Cookbook recipes for this lib, embedded at build time.
pub static RECIPES: sim_cookbook::EmbeddedDir =
    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));

#[cfg(test)]
mod tests;
#[cfg(test)]
mod text_tests;