Create structure for LaTeX fragments.
This commit is contained in:
39
src/parser/latex_fragment.rs
Normal file
39
src/parser/latex_fragment.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
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>> {
|
||||
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,
|
||||
// },
|
||||
// ))
|
||||
}
|
||||
Reference in New Issue
Block a user