Compare footnote reference properties.

This commit is contained in:
Tom Alexander 2023-10-09 13:14:35 -04:00
parent e39562c85d
commit 9565435526
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -3296,20 +3296,46 @@ fn compare_export_snippet<'b, 's>(
}
fn compare_footnote_reference<'b, 's>(
_source: &'s str,
source: &'s str,
emacs: &'b Token<'s>,
rust: &'b FootnoteReference<'s>,
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
let this_status = DiffStatus::Good;
let message = None;
let mut child_status = Vec::new();
let mut this_status = DiffStatus::Good;
let mut message = None;
// TODO: Compare :label :type
compare_children(
source,
emacs,
&rust.definition,
&mut child_status,
&mut this_status,
&mut message,
)?;
if let Some((new_status, new_message)) = compare_properties!(
emacs,
rust,
(
EmacsField::Required(":label"),
|r| r.label,
compare_property_quoted_string
),
(
EmacsField::Required(":type"),
|_| Some("inline"),
compare_property_unquoted_atom
)
)? {
this_status = new_status;
message = new_message;
}
Ok(DiffResult {
status: this_status,
name: rust.get_elisp_name(),
message,
children: Vec::new(),
children: child_status,
rust_source: rust.get_source(),
emacs_token: emacs,
}