Implement the new fields for LaTeX environment.
Some checks failed
clippy Build clippy has failed
rust-foreign-document-test Build rust-foreign-document-test has failed
rust-build Build rust-build has succeeded
rust-test Build rust-test has failed

This commit is contained in:
Tom Alexander 2023-12-11 14:49:18 -05:00
parent 0b42139393
commit 175ff1e6c4
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 9 additions and 3 deletions

View File

@ -57,7 +57,7 @@ where
let (remaining, _end) = latex_environment_end_specialized(&parser_context, remaining)?;
let value_end = remaining;
let (remaining, _trailing_ws) =
let (remaining, post_blank) =
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining);
let value = get_consumed(value_start, value_end);
@ -70,6 +70,7 @@ where
affiliated_keywords,
),
value: value.into(),
post_blank: post_blank.map(Into::<&str>::into),
},
))
}

View File

@ -173,6 +173,7 @@ pub struct LatexEnvironment<'s> {
pub source: &'s str,
pub affiliated_keywords: AffiliatedKeywords<'s>,
pub value: &'s str,
pub post_blank: Option<&'s str>,
}
/// A line number used in switches to lesser blocks.
@ -425,11 +426,15 @@ impl<'s> StandardProperties<'s> for LatexEnvironment<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
todo!()
None
}
fn get_post_blank(&self) -> PostBlank {
todo!()
self.post_blank
.map(|text| text.lines().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
}
}