Compare label.

This commit is contained in:
Tom Alexander 2023-10-02 22:48:54 -04:00
parent ae66d1bd89
commit 4d356b855e
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 14 additions and 3 deletions

View File

@ -1172,9 +1172,20 @@ fn compare_footnote_definition<'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;
// TODO: Compare :label :pre-blank
let mut this_status = DiffStatus::Good;
let mut message = None;
// TODO: Compare :pre-blank
// Compare label
let label = get_property_quoted_string(emacs, ":label")?
.ok_or("Footnote definitions should have a name.")?;
if label != rust.label {
this_status = DiffStatus::Bad;
message = Some(format!(
"Label mismatch (emacs != rust) {:?} != {:?}",
label, rust.label
));
}
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())?);