2023-07-18 20:51:06 -04:00
|
|
|
use nom::branch::alt;
|
|
|
|
use nom::bytes::complete::tag;
|
|
|
|
use nom::bytes::complete::tag_no_case;
|
|
|
|
use nom::character::complete::satisfy;
|
|
|
|
use nom::character::complete::space0;
|
|
|
|
use nom::combinator::eof;
|
|
|
|
use nom::combinator::peek;
|
|
|
|
use nom::combinator::recognize;
|
|
|
|
|
|
|
|
use super::Context;
|
|
|
|
use crate::error::Res;
|
|
|
|
use crate::parser::object::Entity;
|
|
|
|
use crate::parser::parser_with_context::parser_with_context;
|
|
|
|
use crate::parser::util::get_consumed;
|
2023-07-18 21:08:13 -04:00
|
|
|
use crate::parser::util::not_yet_implemented;
|
2023-07-18 20:51:06 -04:00
|
|
|
use crate::parser::LatexFragment;
|
|
|
|
|
|
|
|
#[tracing::instrument(ret, level = "debug")]
|
|
|
|
pub fn latex_fragment<'r, 's>(
|
|
|
|
context: Context<'r, 's>,
|
|
|
|
input: &'s str,
|
|
|
|
) -> Res<&'s str, LatexFragment<'s>> {
|
2023-07-18 21:08:13 -04:00
|
|
|
not_yet_implemented()?;
|
2023-07-18 20:51:06 -04:00
|
|
|
let (remaining, _) = tag("\\")(input)?;
|
|
|
|
todo!()
|
|
|
|
// let (remaining, entity_name) = name(context, remaining)?;
|
|
|
|
// let (remaining, _) = alt((
|
|
|
|
// tag("{}"),
|
|
|
|
// peek(recognize(parser_with_context!(entity_end)(context))),
|
|
|
|
// ))(remaining)?;
|
|
|
|
// let (remaining, _) = space0(remaining)?;
|
|
|
|
|
|
|
|
// let source = get_consumed(input, remaining);
|
|
|
|
// Ok((
|
|
|
|
// remaining,
|
|
|
|
// Entity {
|
|
|
|
// source,
|
|
|
|
// entity_name,
|
|
|
|
// },
|
|
|
|
// ))
|
|
|
|
}
|