Initial code structure for regular links.

This commit is contained in:
Tom Alexander 2023-04-23 16:17:52 -04:00
parent f1bd7f2d1b
commit 3600f46e3b
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 21 additions and 5 deletions

View File

@ -1071,13 +1071,23 @@ fn compare_strike_through<'s>(
} }
fn compare_regular_link<'s>( fn compare_regular_link<'s>(
_source: &'s str, source: &'s str,
_emacs: &'s Token<'s>, emacs: &'s Token<'s>,
_rust: &'s RegularLink<'s>, rust: &'s RegularLink<'s>,
) -> Result<DiffResult, Box<dyn std::error::Error>> { ) -> Result<DiffResult, Box<dyn std::error::Error>> {
let mut this_status = DiffStatus::Good;
let emacs_name = "link";
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 { Ok(DiffResult {
status: DiffStatus::Good, status: this_status,
name: "regular-link".to_owned(), name: emacs_name.to_owned(),
message: None, message: None,
children: Vec::new(), children: Vec::new(),
}) })

View File

@ -111,3 +111,9 @@ impl<'s> Source<'s> for Verbatim<'s> {
self.source self.source
} }
} }
impl<'s> Source<'s> for RegularLink<'s> {
fn get_source(&'s self) -> &'s str {
self.source
}
}