diff --git a/src/compare/diff.rs b/src/compare/diff.rs index 8bacae3..00c09da 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -1589,13 +1589,28 @@ fn compare_property_drawer<'b, 's>( emacs: &'b Token<'s>, rust: &'b PropertyDrawer<'s>, ) -> Result, Box> { - let children = emacs.as_list()?; + let mut this_status = DiffStatus::Good; let mut child_status = Vec::new(); - let this_status = DiffStatus::Good; - let message = None; + let mut message = None; - 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())?); + compare_children( + source, + emacs, + &rust.children, + &mut child_status, + &mut this_status, + &mut message, + )?; + + for diff in compare_properties!(emacs) { + match diff { + ComparePropertiesResult::NoChange => {} + ComparePropertiesResult::SelfChange(new_status, new_message) => { + this_status = new_status; + message = new_message + } + ComparePropertiesResult::DiffEntry(diff_entry) => child_status.push(diff_entry), + } } Ok(DiffResult {