ryo-pattern
Status: stable. Part of the ryo workspace — AST-centric Rust programming for AI agents.
RyoPattern — declarative AST pattern matching and lint rules for Rust.
Read-only structural matching with composable any / all / none grouping,
schema-driven definitions for LLM-perfect query generation, and pre-computed
relation graphs.
Install
Quickstart
use ;
// Parse a concrete pattern
let pattern = parse_pattern?;
// Match against AST nodes
let engine = new;
let matches = engine.run;
for m in matches
API Summary
| Item | Purpose |
|---|---|
CodePattern |
AST node predicate (structural matching) |
parse_pattern / ConcreteParser |
Pattern DSL parser |
RuleEngine / Rule |
Query + message + severity bundles |
MatchResult |
Match outcome with {$VAR: Node} captures |
generator::* |
Template-based code generation |
loader::* |
Pattern loading from files |
Status
API surface considered stable for the v0.1.0 release. Pattern matching
remains read-only; mutations are owned by downstream crates such as
ryo-mutations.
License
Licensed under either of Apache-2.0 or MIT at your option.