Compare macro properties.
This commit is contained in:
@@ -6,6 +6,7 @@ use std::collections::HashSet;
|
||||
|
||||
use super::compare_field::compare_identity;
|
||||
use super::compare_field::compare_property_always_nil;
|
||||
use super::compare_field::compare_property_list_of_quoted_string;
|
||||
use super::compare_field::compare_property_quoted_string;
|
||||
use super::compare_field::compare_property_unquoted_atom;
|
||||
use super::elisp_fact::ElispFact;
|
||||
@@ -3068,10 +3069,35 @@ fn compare_org_macro<'b, 's>(
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b OrgMacro<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let this_status = DiffStatus::Good;
|
||||
let message = None;
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut message = None;
|
||||
|
||||
// TODO: Compare :key :value :args
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
EmacsField::Required(":key"),
|
||||
|r| Some(r.macro_name),
|
||||
compare_property_quoted_string
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":value"),
|
||||
|r| Some(r.source),
|
||||
compare_property_quoted_string
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":args"),
|
||||
|r| if r.macro_args.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(&r.macro_args)
|
||||
},
|
||||
compare_property_list_of_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
}
|
||||
|
||||
Ok(DiffResult {
|
||||
status: this_status,
|
||||
|
||||
Reference in New Issue
Block a user