Just doing a simple match everything for path reg.

This commit is contained in:
Tom Alexander 2023-04-23 17:37:35 -04:00
parent 8a828195bd
commit b4d4453186
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -1,7 +1,14 @@
use nom::branch::alt; use nom::branch::alt;
use nom::bytes::complete::escaped;
use nom::bytes::complete::tag; use nom::bytes::complete::tag;
use nom::bytes::complete::take_till1;
use nom::character::complete::line_ending;
use nom::character::complete::one_of;
use nom::character::complete::space0;
use nom::combinator::opt;
use nom::combinator::verify; use nom::combinator::verify;
use nom::multi::many_till; use nom::multi::many_till;
use nom::sequence::tuple;
use super::parser_with_context::parser_with_context; use super::parser_with_context::parser_with_context;
use super::util::get_consumed; use super::util::get_consumed;
@ -54,9 +61,15 @@ pub fn regular_link_with_description<'r, 's>(
#[tracing::instrument(ret, level = "debug")] #[tracing::instrument(ret, level = "debug")]
pub fn pathreg<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> { pub fn pathreg<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
let (remaining, _opening_bracket) = tag("[[")(input)?; let (remaining, path) = escaped(
// pathreg take_till1(|c| match c {
todo!() '\\' | ']' => true,
_ => false,
}),
'\\',
one_of(r#"]"#),
)(input)?;
Ok((remaining, path))
} }
#[tracing::instrument(ret, level = "debug")] #[tracing::instrument(ret, level = "debug")]