Switch to returning ComparePropertiesResult.
This is to support returning lists of child results for properties that contain lists of ast nodes.
This commit is contained in:
@@ -8,6 +8,7 @@ use super::compare_field::compare_identity;
|
||||
use super::compare_field::compare_noop;
|
||||
use super::compare_field::compare_property_always_nil;
|
||||
use super::compare_field::compare_property_boolean;
|
||||
use super::compare_field::compare_property_list_of_ast_nodes;
|
||||
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;
|
||||
@@ -23,6 +24,7 @@ use super::util::get_property_boolean;
|
||||
use super::util::get_property_numeric;
|
||||
use super::util::get_property_quoted_string;
|
||||
use super::util::get_property_unquoted_atom;
|
||||
use crate::compare::compare_field::ComparePropertiesResult;
|
||||
use crate::compare::compare_field::EmacsField;
|
||||
use crate::compare::macros::compare_properties;
|
||||
use crate::types::AngleLink;
|
||||
@@ -328,8 +330,8 @@ impl<'b, 's> DiffLayer<'b, 's> {
|
||||
}
|
||||
}
|
||||
|
||||
fn artificial_diff_scope<'b, 's>(
|
||||
name: &'static str,
|
||||
pub(crate) fn artificial_diff_scope<'b, 's>(
|
||||
name: &'s str,
|
||||
children: Vec<DiffEntry<'b, 's>>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
Ok(DiffLayer {
|
||||
@@ -2598,16 +2600,22 @@ fn compare_bold<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(emacs)? {
|
||||
this_status = new_status;
|
||||
message = new_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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2632,16 +2640,22 @@ fn compare_italic<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(emacs)? {
|
||||
this_status = new_status;
|
||||
message = new_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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2666,16 +2680,22 @@ fn compare_underline<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(emacs)? {
|
||||
this_status = new_status;
|
||||
message = new_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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2683,16 +2703,18 @@ fn compare_underline<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_verbatim<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b Verbatim<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -2700,16 +2722,22 @@ fn compare_verbatim<'b, 's>(
|
||||
|r| Some(r.contents),
|
||||
compare_property_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2717,16 +2745,18 @@ fn compare_verbatim<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_code<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b Code<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -2734,16 +2764,22 @@ fn compare_code<'b, 's>(
|
||||
|r| Some(r.contents),
|
||||
compare_property_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2768,16 +2804,22 @@ fn compare_strike_through<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(emacs)? {
|
||||
this_status = new_status;
|
||||
message = new_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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2802,7 +2844,8 @@ fn compare_regular_link<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -2844,16 +2887,22 @@ fn compare_regular_link<'b, 's>(
|
||||
|r| r.get_search_option(),
|
||||
compare_property_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2878,7 +2927,8 @@ fn compare_radio_link<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -2911,16 +2961,22 @@ fn compare_radio_link<'b, 's>(
|
||||
compare_identity,
|
||||
compare_property_always_nil
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2945,7 +3001,8 @@ fn compare_radio_target<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -2953,16 +3010,22 @@ fn compare_radio_target<'b, 's>(
|
||||
|r| Some(r.value),
|
||||
compare_property_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -2970,16 +3033,18 @@ fn compare_radio_target<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_plain_link<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b PlainLink<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3021,16 +3086,22 @@ fn compare_plain_link<'b, 's>(
|
||||
|r| r.search_option,
|
||||
compare_property_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -3038,16 +3109,18 @@ fn compare_plain_link<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_angle_link<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b AngleLink<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3089,16 +3162,22 @@ fn compare_angle_link<'b, 's>(
|
||||
|r| r.get_search_option(),
|
||||
compare_property_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -3106,16 +3185,18 @@ fn compare_angle_link<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_org_macro<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b OrgMacro<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3137,16 +3218,22 @@ fn compare_org_macro<'b, 's>(
|
||||
},
|
||||
compare_property_list_of_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -3154,16 +3241,18 @@ fn compare_org_macro<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_entity<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b Entity<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3207,16 +3296,22 @@ fn compare_entity<'b, 's>(
|
||||
|r| r.use_brackets,
|
||||
compare_property_boolean
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -3224,16 +3319,18 @@ fn compare_entity<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_latex_fragment<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b LatexFragment<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3241,16 +3338,22 @@ fn compare_latex_fragment<'b, 's>(
|
||||
|r| Some(r.value),
|
||||
compare_property_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -3258,16 +3361,18 @@ fn compare_latex_fragment<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_export_snippet<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b ExportSnippet<'s>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3280,16 +3385,22 @@ fn compare_export_snippet<'b, 's>(
|
||||
|r| r.contents,
|
||||
compare_property_quoted_string
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -3314,7 +3425,8 @@ fn compare_footnote_reference<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3330,9 +3442,15 @@ fn compare_footnote_reference<'b, 's>(
|
||||
}),
|
||||
compare_property_unquoted_atom
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
@@ -3364,7 +3482,8 @@ fn compare_citation<'b, 's>(
|
||||
&mut message,
|
||||
)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3374,24 +3493,30 @@ fn compare_citation<'b, 's>(
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":prefix"),
|
||||
|r| r.prefix,
|
||||
compare_property_unquoted_atom
|
||||
|r| Some(r.prefix.iter()),
|
||||
compare_property_list_of_ast_nodes
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":suffix"),
|
||||
|r| r.suffix,
|
||||
compare_property_unquoted_atom
|
||||
|r| Some(r.suffix.iter()),
|
||||
compare_property_list_of_ast_nodes
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
@@ -3399,16 +3524,18 @@ fn compare_citation<'b, 's>(
|
||||
}
|
||||
|
||||
fn compare_citation_reference<'b, 's>(
|
||||
_source: &'s str,
|
||||
source: &'s str,
|
||||
emacs: &'b Token<'s>,
|
||||
rust: &'b CitationReference<'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 child_status = Vec::new();
|
||||
let mut message = None;
|
||||
|
||||
assert_no_children(emacs, &mut this_status, &mut message)?;
|
||||
|
||||
if let Some((new_status, new_message)) = compare_properties!(
|
||||
for diff in compare_properties!(
|
||||
source,
|
||||
emacs,
|
||||
rust,
|
||||
(
|
||||
@@ -3418,24 +3545,30 @@ fn compare_citation_reference<'b, 's>(
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":prefix"),
|
||||
|r| r.prefix,
|
||||
compare_property_unquoted_atom
|
||||
|r| Some(r.prefix.iter()),
|
||||
compare_property_list_of_ast_nodes
|
||||
),
|
||||
(
|
||||
EmacsField::Required(":suffix"),
|
||||
|r| r.suffix,
|
||||
compare_property_unquoted_atom
|
||||
|r| Some(r.suffix.iter()),
|
||||
compare_property_list_of_ast_nodes
|
||||
)
|
||||
)? {
|
||||
this_status = new_status;
|
||||
message = new_message;
|
||||
) {
|
||||
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 {
|
||||
status: this_status,
|
||||
name: rust.get_elisp_name(),
|
||||
message,
|
||||
children: Vec::new(),
|
||||
children: child_status,
|
||||
rust_source: rust.get_source(),
|
||||
emacs_token: emacs,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user