refactor(natu): rename xatu
This commit was merged in pull request #97.
This commit is contained in:
24
src/natu/rules/manual_inherit.rs
Normal file
24
src/natu/rules/manual_inherit.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use crate::{ast, rules::NodeRule};
|
||||
|
||||
pub struct ManualInherit;
|
||||
|
||||
impl NodeRule for ManualInherit {
|
||||
type Node = ast::Binding;
|
||||
|
||||
const ID: &'static str = "manual_inherit";
|
||||
|
||||
fn select(data: &ast::NodeData) -> Option<&Self::Node> {
|
||||
let ast::NodeData::Binding(binding) = data;
|
||||
|
||||
Some(binding)
|
||||
}
|
||||
|
||||
fn check(node: &Self::Node) -> Option<&'static str> {
|
||||
match &node.value {
|
||||
ast::Expr::Ident(value) if node.key == *value => {
|
||||
Some("Use `inherit` for this assignment")
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user