deimos-lang/old-march-2026/ast-generator/src/spec/leaf_enum_spec.rs
2026-03-25 11:20:46 -05:00

22 lines
419 B
Rust

pub struct LeafEnumBuildSpec {
build: String,
rules: Vec<String>,
}
impl LeafEnumBuildSpec {
pub fn new(build: &str, rules: Vec<String>) -> Self {
Self {
build: build.to_string(),
rules,
}
}
pub fn build(&self) -> &str {
&self.build
}
pub fn rules(&self) -> impl Iterator<Item = &str> {
self.rules.iter().map(AsRef::as_ref)
}
}