2026-03-24 13:42:13 +00:00

21 lines
502 B
Rust

#[derive(Debug, Clone)]
pub struct SourcePolicy {
pub extensions: Vec<&'static str>,
pub case_sensitive: bool,
}
impl SourcePolicy {
pub fn matches_ext(&self, ext: &str) -> bool {
if self.case_sensitive {
self.extensions.iter().any(|e| *e == ext)
} else {
self.extensions.iter().any(|e| e.eq_ignore_ascii_case(ext))
}
}
}
#[derive(Debug, Clone)]
pub struct LanguageSpec {
pub id: &'static str,
pub source_policy: SourcePolicy,
}