Code structure for fixed width area.
This commit is contained in:
@@ -12,6 +12,7 @@ use crate::parser::DynamicBlock;
|
||||
use crate::parser::Element;
|
||||
use crate::parser::ExampleBlock;
|
||||
use crate::parser::ExportBlock;
|
||||
use crate::parser::FixedWidthArea;
|
||||
use crate::parser::FootnoteDefinition;
|
||||
use crate::parser::GreaterBlock;
|
||||
use crate::parser::Heading;
|
||||
@@ -219,6 +220,7 @@ fn compare_element<'s>(
|
||||
Element::Clock(obj) => compare_clock(source, emacs, obj),
|
||||
Element::DiarySexp(obj) => compare_diary_sexp(source, emacs, obj),
|
||||
Element::Planning(obj) => compare_planning(source, emacs, obj),
|
||||
Element::FixedWidthArea(obj) => compare_fixed_width_area(source, emacs, obj),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -752,3 +754,27 @@ fn compare_planning<'s>(
|
||||
children: Vec::new(),
|
||||
})
|
||||
}
|
||||
|
||||
fn compare_fixed_width_area<'s>(
|
||||
source: &'s str,
|
||||
emacs: &'s Token<'s>,
|
||||
rust: &'s FixedWidthArea<'s>,
|
||||
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
||||
let child_status = Vec::new();
|
||||
let mut this_status = DiffStatus::Good;
|
||||
let emacs_name = "fixed-width";
|
||||
if assert_name(emacs, emacs_name).is_err() {
|
||||
this_status = DiffStatus::Bad;
|
||||
}
|
||||
|
||||
if assert_bounds(source, emacs, rust).is_err() {
|
||||
this_status = DiffStatus::Bad;
|
||||
}
|
||||
|
||||
Ok(DiffResult {
|
||||
status: this_status,
|
||||
name: emacs_name.to_owned(),
|
||||
message: None,
|
||||
children: child_status,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user