Add capitalization.
This commit is contained in:
@@ -8,6 +8,7 @@ use super::sexp::Token;
|
||||
use crate::compare::diff::compare_ast_node;
|
||||
use crate::compare::sexp::unquote;
|
||||
use crate::types::AstNode;
|
||||
use crate::types::GetAffiliatedKeywords;
|
||||
use crate::types::GetStandardProperties;
|
||||
use crate::types::StandardProperties;
|
||||
|
||||
@@ -337,3 +338,38 @@ where
|
||||
}
|
||||
Ok(ComparePropertiesResult::NoChange)
|
||||
}
|
||||
|
||||
pub(crate) fn compare_affiliated_keywords<'b, 's, GAK>(
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b GAK,
|
||||
) -> Result<ComparePropertiesResult<'b, 's>, Box<dyn std::error::Error>>
|
||||
where
|
||||
GAK: GetAffiliatedKeywords<'s>,
|
||||
{
|
||||
let affiliated_keywords = rust.get_affiliated_keywords();
|
||||
for (rust_name, rust_value) in affiliated_keywords.keywords.iter() {
|
||||
let emacs_property_name = format!(":{}", rust_name);
|
||||
let emacs_property = get_property(emacs, emacs_property_name.as_str())?;
|
||||
if let Some(emacs_property) = emacs_property {
|
||||
// foo
|
||||
} else {
|
||||
let this_status = DiffStatus::Bad;
|
||||
let message = Some(format!(
|
||||
"{} mismatch (emacs != rust) {:?} != {:?}",
|
||||
rust_name, emacs_property, rust_value
|
||||
));
|
||||
return Ok(ComparePropertiesResult::SelfChange(this_status, message));
|
||||
}
|
||||
}
|
||||
Ok(ComparePropertiesResult::NoChange)
|
||||
}
|
||||
|
||||
pub(crate) fn affiliated_keywords_names<'s, GAK>(rust: &'s GAK) -> impl Iterator<Item = String> + 's
|
||||
where
|
||||
GAK: GetAffiliatedKeywords<'s>,
|
||||
{
|
||||
rust.get_affiliated_keywords()
|
||||
.keywords
|
||||
.keys()
|
||||
.map(|k| format!(":{}", k))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user