2022-07-16 17:27:08 -04:00
|
|
|
use nom::branch::alt;
|
2022-07-15 23:26:49 -04:00
|
|
|
use nom::error::VerboseError;
|
2022-07-16 16:31:00 -04:00
|
|
|
use nom::IResult;
|
2022-07-17 18:17:41 -04:00
|
|
|
|
2022-07-16 17:52:04 -04:00
|
|
|
#[derive(Clone)]
|
2022-10-14 20:06:10 -04:00
|
|
|
pub struct NomContext
|
|
|
|
// where
|
|
|
|
// F: for<'a> FnMut(&'a str) -> IResult<&'a str, &'a str, VerboseError<&'a str>>,
|
|
|
|
// F: Clone,
|
2022-07-16 21:16:34 -04:00
|
|
|
{
|
2022-10-14 20:06:10 -04:00
|
|
|
// pub fail_matcher: F,
|
2022-07-15 23:26:49 -04:00
|
|
|
/// You can't have nested bolds in org-mode
|
|
|
|
pub can_match_bold: bool,
|
|
|
|
pub can_match_link: bool,
|
|
|
|
}
|
|
|
|
|
2022-10-14 20:06:10 -04:00
|
|
|
impl NomContext {
|
2022-07-16 21:32:23 -04:00
|
|
|
pub fn new(fail_matcher: F) -> Self {
|
|
|
|
NomContext {
|
2022-10-14 20:06:10 -04:00
|
|
|
// fail_matcher,
|
2022-07-16 21:55:33 -04:00
|
|
|
can_match_bold: true,
|
|
|
|
can_match_link: true,
|
|
|
|
}
|
|
|
|
}
|
2022-07-16 21:32:23 -04:00
|
|
|
}
|