use super::*;
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub enum ListPrefixSymbol {
Unknown,
Hyphen,
Quote,
SummaryOpen,
SummaryClosed,
Arabic,
ArabicNest {
prefix_number: Vec<usize>,
number: usize,
},
RomanNumerals,
}
impl Default for ListPrefixSymbol {
fn default() -> Self {
Self::Hyphen
}
}
impl ListPrefixSymbol {
pub fn parse(input: &str) -> Self {
match input {
s if s.starts_with(">") => Self::Quote,
_ => Self::Unknown,
}
}
}
impl ListPrefixSymbol {
#[inline]
pub fn is_quote(&self) -> bool {
matches!(self, Self::Quote)
}
#[inline]
pub fn is_ordered(&self) -> bool {
matches!(self, Self::Arabic | Self::ArabicNest { .. })
}
}