Compare latex fragment properties.
This commit is contained in:
parent
ea29ad8667
commit
4e551e6d7e
@ -3185,10 +3185,21 @@ fn compare_latex_fragment<'b, 's>(
|
|||||||
emacs: &'b Token<'s>,
|
emacs: &'b Token<'s>,
|
||||||
rust: &'b LatexFragment<'s>,
|
rust: &'b LatexFragment<'s>,
|
||||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||||
let this_status = DiffStatus::Good;
|
let mut this_status = DiffStatus::Good;
|
||||||
let message = None;
|
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 {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
|
@ -36,6 +36,7 @@ pub(crate) fn latex_fragment<'b, 'g, 'r, 's>(
|
|||||||
parser_with_context!(dollar_char_fragment)(context),
|
parser_with_context!(dollar_char_fragment)(context),
|
||||||
parser_with_context!(bordered_dollar_fragment)(context),
|
parser_with_context!(bordered_dollar_fragment)(context),
|
||||||
))(input)?;
|
))(input)?;
|
||||||
|
let value = get_consumed(input, remaining);
|
||||||
let (remaining, _trailing_whitespace) =
|
let (remaining, _trailing_whitespace) =
|
||||||
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
|
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||||
let source = get_consumed(input, remaining);
|
let source = get_consumed(input, remaining);
|
||||||
@ -43,6 +44,7 @@ pub(crate) fn latex_fragment<'b, 'g, 'r, 's>(
|
|||||||
remaining,
|
remaining,
|
||||||
LatexFragment {
|
LatexFragment {
|
||||||
source: source.into(),
|
source: source.into(),
|
||||||
|
value: value.into(),
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,7 @@ pub struct Entity<'s> {
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub struct LatexFragment<'s> {
|
pub struct LatexFragment<'s> {
|
||||||
pub source: &'s str,
|
pub source: &'s str,
|
||||||
|
pub value: &'s str,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user