Compare commits
No commits in common. "e686666ea053c0e46a7c6e0e47d7999e6e78fca5" and "627c785e24bee58df4996aa8c9c70690aa8f1859" have entirely different histories.
e686666ea0
...
627c785e24
@ -2567,19 +2567,13 @@ fn compare_plain_text<'b, 's>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn compare_bold<'b, 's>(
|
fn compare_bold<'b, 's>(
|
||||||
source: &'s str,
|
_source: &'s str,
|
||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust: &'b Bold<'s>,
|
rust: &'b Bold<'s>,
|
||||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
|
||||||
let this_status = DiffStatus::Good;
|
let this_status = DiffStatus::Good;
|
||||||
let mut child_status = Vec::new();
|
|
||||||
let message = None;
|
let 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())?);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(DiffResult {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
name: rust.get_elisp_name(),
|
name: rust.get_elisp_name(),
|
||||||
@ -2592,19 +2586,13 @@ fn compare_bold<'b, 's>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn compare_italic<'b, 's>(
|
fn compare_italic<'b, 's>(
|
||||||
source: &'s str,
|
_source: &'s str,
|
||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust: &'b Italic<'s>,
|
rust: &'b Italic<'s>,
|
||||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
|
||||||
let this_status = DiffStatus::Good;
|
let this_status = DiffStatus::Good;
|
||||||
let mut child_status = Vec::new();
|
|
||||||
let message = None;
|
let 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())?);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(DiffResult {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
name: rust.get_elisp_name(),
|
name: rust.get_elisp_name(),
|
||||||
@ -2617,19 +2605,13 @@ fn compare_italic<'b, 's>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn compare_underline<'b, 's>(
|
fn compare_underline<'b, 's>(
|
||||||
source: &'s str,
|
_source: &'s str,
|
||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust: &'b Underline<'s>,
|
rust: &'b Underline<'s>,
|
||||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
|
||||||
let this_status = DiffStatus::Good;
|
let this_status = DiffStatus::Good;
|
||||||
let mut child_status = Vec::new();
|
|
||||||
let message = None;
|
let 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())?);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(DiffResult {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
name: rust.get_elisp_name(),
|
name: rust.get_elisp_name(),
|
||||||
@ -2646,18 +2628,10 @@ fn compare_verbatim<'b, 's>(
|
|||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust: &'b Verbatim<'s>,
|
rust: &'b Verbatim<'s>,
|
||||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let mut this_status = DiffStatus::Good;
|
let this_status = DiffStatus::Good;
|
||||||
let mut message = None;
|
let message = None;
|
||||||
|
|
||||||
// Compare value
|
// TODO: Compare :value
|
||||||
let value = get_property_quoted_string(emacs, ":value")?;
|
|
||||||
if value.as_ref().map(String::as_str) != Some(rust.contents) {
|
|
||||||
this_status = DiffStatus::Bad;
|
|
||||||
message = Some(format!(
|
|
||||||
"Value mismatch (emacs != rust) {:?} != {:?}",
|
|
||||||
value, rust.contents
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(DiffResult {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
@ -2675,18 +2649,10 @@ fn compare_code<'b, 's>(
|
|||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust: &'b Code<'s>,
|
rust: &'b Code<'s>,
|
||||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let mut this_status = DiffStatus::Good;
|
let this_status = DiffStatus::Good;
|
||||||
let mut message = None;
|
let message = None;
|
||||||
|
|
||||||
// Compare value
|
// TODO: Compare :value
|
||||||
let value = get_property_quoted_string(emacs, ":value")?;
|
|
||||||
if value.as_ref().map(String::as_str) != Some(rust.contents) {
|
|
||||||
this_status = DiffStatus::Bad;
|
|
||||||
message = Some(format!(
|
|
||||||
"Value mismatch (emacs != rust) {:?} != {:?}",
|
|
||||||
value, rust.contents
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(DiffResult {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
@ -2700,19 +2666,13 @@ fn compare_code<'b, 's>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn compare_strike_through<'b, 's>(
|
fn compare_strike_through<'b, 's>(
|
||||||
source: &'s str,
|
_source: &'s str,
|
||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust: &'b StrikeThrough<'s>,
|
rust: &'b StrikeThrough<'s>,
|
||||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
|
||||||
let this_status = DiffStatus::Good;
|
let this_status = DiffStatus::Good;
|
||||||
let mut child_status = Vec::new();
|
|
||||||
let message = None;
|
let 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())?);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(DiffResult {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
name: rust.get_elisp_name(),
|
name: rust.get_elisp_name(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user