use crate::{Language, LanguageSymbols};
pub struct Yuri;
impl Language for Yuri {
fn name(&self) -> &'static str {
"Yuri"
}
fn extensions(&self) -> &'static [&'static str] {
&["yuri"]
}
fn grammar_name(&self) -> &'static str {
"yuri"
}
fn as_symbols(&self) -> Option<&dyn LanguageSymbols> {
Some(self)
}
fn is_test_symbol(&self, symbol: &crate::Symbol) -> bool {
let name = symbol.name.as_str();
match symbol.kind {
crate::SymbolKind::Function | crate::SymbolKind::Method => name.starts_with("test_"),
crate::SymbolKind::Module => name == "tests" || name == "test",
_ => false,
}
}
}
impl LanguageSymbols for Yuri {}
#[cfg(test)]
mod tests {
use super::*;
use crate::validate_unused_kinds_audit;
#[test]
fn unused_node_kinds_audit() {
#[rustfmt::skip]
let documented_unused: &[&str] = &[
"function_item", "function_parameters", "module_item", "import_item",
"type_alias_item", "compound_type_item", "compound_type_field",
"array_type_item", "primitive_type",
"break_statement", "continue_statement", "return_statement",
"else_clause",
"if_expression", "binary_expression", "unary_expression",
"call_expression", "paren_expression", "array_expression",
"compound_value_expression",
"block", "identifier",
];
validate_unused_kinds_audit(&Yuri, documented_unused)
.expect("Yuri unused node kinds audit failed");
}
}