Compare row type.
This commit is contained in:
@@ -86,6 +86,7 @@ use crate::types::Superscript;
|
||||
use crate::types::Table;
|
||||
use crate::types::TableCell;
|
||||
use crate::types::TableRow;
|
||||
use crate::types::TableRowType;
|
||||
use crate::types::Target;
|
||||
use crate::types::Time;
|
||||
use crate::types::TimeUnit;
|
||||
@@ -1427,12 +1428,23 @@ fn compare_table_row<'b, 's>(
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
let children = emacs.as_list()?;
|
||||
let mut child_status = Vec::new();
|
||||
let this_status = DiffStatus::Good;
|
||||
let message = None;
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let mut message = None;
|
||||
|
||||
// TODO: Compare :type
|
||||
//
|
||||
// :type is an unquoted atom of either standard or rule
|
||||
// Compare type
|
||||
let row_type = get_property_unquoted_atom(emacs, ":type")?;
|
||||
let rust_row_type = rust.get_type();
|
||||
match (row_type, &rust_row_type) {
|
||||
(Some("standard"), TableRowType::Standard) => {}
|
||||
(Some("rule"), TableRowType::Rule) => {}
|
||||
_ => {
|
||||
this_status = DiffStatus::Bad;
|
||||
message = Some(format!(
|
||||
"Type mismatch (emacs != rust) {:?} != {:?}",
|
||||
row_type, rust_row_type
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
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())?);
|
||||
|
||||
Reference in New Issue
Block a user