Coalesce whitespace in macro args.

This commit is contained in:
Tom Alexander
2023-10-08 15:08:21 -04:00
parent 37bc5ef712
commit a32cea8139
4 changed files with 63 additions and 5 deletions

View File

@@ -108,10 +108,10 @@ pub(crate) fn compare_property_list_of_quoted_string<
'b,
's,
'x,
'y,
R,
RV: AsRef<str> + std::fmt::Debug + 'y,
RG: Fn(R) -> Option<&'y Vec<RV>>,
RV: AsRef<str> + std::fmt::Debug,
RI: Iterator<Item = RV>,
RG: Fn(R) -> Option<RI>,
>(
emacs: &'b Token<'s>,
rust_node: R,
@@ -122,7 +122,9 @@ pub(crate) fn compare_property_list_of_quoted_string<
.map(Token::as_list)
.map_or(Ok(None), |r| r.map(Some))?;
let rust_value = rust_value_getter(rust_node);
match (value, rust_value) {
// TODO: Seems we are needlessly coverting to a vec here.
let rust_value: Option<Vec<RV>> = rust_value.map(|it| it.collect());
match (value, &rust_value) {
(None, None) => {}
(None, Some(_)) | (Some(_), None) => {
let this_status = DiffStatus::Bad;

View File

@@ -3090,7 +3090,7 @@ fn compare_org_macro<'b, 's>(
|r| if r.macro_args.is_empty() {
None
} else {
Some(&r.macro_args)
Some(r.get_macro_args())
},
compare_property_list_of_quoted_string
)