2022-12-18 10:02:32 +00:00
|
|
|
use nom::branch::alt;
|
|
|
|
use nom::bytes::complete::tag;
|
|
|
|
use nom::character::complete::digit1;
|
|
|
|
use nom::character::complete::one_of;
|
|
|
|
use nom::combinator::recognize;
|
|
|
|
use nom::sequence::tuple;
|
|
|
|
|
2022-12-18 08:29:01 +00:00
|
|
|
use super::error::Res;
|
2022-12-18 10:02:32 +00:00
|
|
|
use super::token::ListItem;
|
2022-12-18 08:29:01 +00:00
|
|
|
use super::token::PlainList;
|
|
|
|
use super::Context;
|
|
|
|
|
|
|
|
pub fn plain_list<'r, 's>(context: Context<'r, 's>, i: &'s str) -> Res<&'s str, PlainList<'s>> {
|
|
|
|
// todo
|
|
|
|
todo!()
|
|
|
|
}
|
2022-12-18 10:02:32 +00:00
|
|
|
|
|
|
|
fn item<'r, 's>(context: Context<'r, 's>, i: &'s str) -> Res<&'s str, ListItem<'s>> {
|
|
|
|
// todo
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn counter<'s>(i: &'s str) -> Res<&'s str, &'s str> {
|
|
|
|
alt((recognize(one_of("abcdefghijklmnopqrstuvwxyz")), digit1))(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn bullet<'s>(i: &'s str) -> Res<&'s str, &'s str> {
|
|
|
|
alt((
|
|
|
|
tag("*"),
|
|
|
|
tag("-"),
|
|
|
|
tag("+"),
|
|
|
|
recognize(tuple((counter, alt((tag("."), tag(")")))))),
|
|
|
|
))(i)
|
|
|
|
}
|