Deleting some extra parsers that I'll need later but they're just in the way right now.

This commit is contained in:
Tom Alexander 2022-07-16 18:12:52 -04:00
parent 981eeb5326
commit 83c5a545e0
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 0 additions and 63 deletions

View File

@ -1,16 +0,0 @@
//! Text between asterisks to make it bold.
use super::failable_sequence::failable_sequence;
use super::nom_context::NomContext;
use super::text::bold_end;
use super::text::bold_start;
use super::text_element_parser::text_element;
use nom::branch::alt;
use nom::combinator::map;
use nom::combinator::not;
use nom::combinator::recognize;
use nom::error::VerboseError;
use nom::sequence::tuple;
// Sequence
failable_sequence!(bold, i, context, bold_start, text_element, bold_end);

View File

@ -1,45 +0,0 @@
macro_rules! failable_sequence {
($name:ident,$inp:ident,$context:ident,$begin_matcher:expr,$element_matcher:expr,$success_matcher:expr) => {
pub fn $name<I, O, E>(
$context: &NomContext<I, O, E>,
) -> impl for<'a> FnMut(
&'a str,
) -> nom::IResult<
&'a str,
crate::parser::text::Sequence<'a>,
VerboseError<&'a str>,
> {
move |$inp: &str| {
// let new_context = $context.with_no_bold();
// // let other_new_context = NomContext::with_additional_fail_matcher(
// // |i: &str| recognize($success_matcher)(i),
// // $context,
// // );
// // let other_new_context =
// // super::nom_context::NomContext::new($context.fail_matcher.clone());
// let element_matcher = recognize($element_matcher(&new_context));
// let local_fail_matcher = $context.fail_matcher.clone();
// let ret = map(
// recognize(tuple((
// $begin_matcher,
// nom::multi::many_till(
// nom::sequence::preceded(
// not(|i| local_fail_matcher.borrow_mut()(i)),
// element_matcher,
// ),
// nom::sequence::preceded(
// not(|i| local_fail_matcher.borrow_mut()(i)),
// $success_matcher,
// ),
// ),
// ))),
// |s: &str| crate::parser::text::Sequence { contents: s },
// )($inp)?;
// Ok(ret)
todo!()
}
}
};
}
pub(crate) use failable_sequence;

View File

@ -1,5 +1,3 @@
mod bold_parser;
mod failable_sequence;
mod nom_context;
mod parser_with_context;
mod text;