Merge branch 'latex_fragment_properties'

This commit is contained in:
Tom Alexander 2023-10-09 13:01:29 -04:00
commit 8dde8ce4e1
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 17 additions and 3 deletions

View File

@ -3185,10 +3185,21 @@ fn compare_latex_fragment<'b, 's>(
emacs: &'b Token<'s>,
rust: &'b LatexFragment<'s>,
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
let this_status = DiffStatus::Good;
let message = None;
let mut this_status = DiffStatus::Good;
let mut message = None;
// TODO: Compare :value
if let Some((new_status, new_message)) = compare_properties!(
emacs,
rust,
(
EmacsField::Required(":value"),
|r| Some(r.value),
compare_property_quoted_string
)
)? {
this_status = new_status;
message = new_message;
}
Ok(DiffResult {
status: this_status,

View File

@ -36,6 +36,7 @@ pub(crate) fn latex_fragment<'b, 'g, 'r, 's>(
parser_with_context!(dollar_char_fragment)(context),
parser_with_context!(bordered_dollar_fragment)(context),
))(input)?;
let value = get_consumed(input, remaining);
let (remaining, _trailing_whitespace) =
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining);
@ -43,6 +44,7 @@ pub(crate) fn latex_fragment<'b, 'g, 'r, 's>(
remaining,
LatexFragment {
source: source.into(),
value: value.into(),
},
))
}

View File

@ -180,6 +180,7 @@ pub struct Entity<'s> {
#[derive(Debug, PartialEq)]
pub struct LatexFragment<'s> {
pub source: &'s str,
pub value: &'s str,
}
#[derive(Debug, PartialEq)]