sim_lib_pattern/dialect.rs
1//! Dialect compiler seam for text-pattern syntaxes.
2
3use sim_kernel::Result;
4
5use crate::TextOp;
6
7/// A surface pattern syntax that compiles to the shared text-pattern VM.
8pub trait PatternDialect: Send + Sync {
9 /// Compiles `pattern` into VM operations.
10 ///
11 /// # Errors
12 ///
13 /// Returns an error when the surface pattern is malformed.
14 fn compile(&self, pattern: &str) -> Result<Vec<TextOp>>;
15}