Add check for name on paragraph.

This commit is contained in:
Tom Alexander
2023-10-04 19:56:39 -04:00
parent 057c8a1387
commit a26640355c
5 changed files with 26 additions and 3 deletions

View File

@@ -841,8 +841,18 @@ fn compare_paragraph<'b, 's>(
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
let children = emacs.as_list()?;
let mut child_status = Vec::new();
let this_status = DiffStatus::Good;
let message = None;
let mut this_status = DiffStatus::Good;
let mut message = None;
// Compare name
let name = get_property_quoted_string(emacs, ":name")?;
if name.as_ref().map(String::as_str) != rust.name {
this_status = DiffStatus::Bad;
message = Some(format!(
"Name mismatch (emacs != rust) {:?} != {:?}",
name, rust.name
));
}
for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) {
child_status.push(compare_ast_node(source, emacs_child, rust_child.into())?);