use super::*;
mod detailed;
mod simple;
pub use self::{detailed::ListDetailedNode, simple::ListSimpleNode};
#[derive(Clone, Eq, PartialEq, Hash)]
pub enum ListView {
Quote(Box<ListSimpleNode>),
Ordered(Box<ListSimpleNode>),
Orderless(Box<ListSimpleNode>),
Details(Box<ListDetailedNode>),
}
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub enum ListPrefixSymbol {
Hyphen,
Quote,
SummaryOpen,
SummaryClosed,
Arabic,
ArabicNest { prefix_number: Vec<usize>, number: usize },
RomanNumerals,
}
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub struct ListItem {
prefix: Literal<ListPrefixSymbol>,
rest: ASTNodes,
}
impl Default for ListPrefixSymbol {
fn default() -> Self {
Self::Hyphen
}
}
impl From<ListView> for ASTNode {
fn from(node: ListView) -> Self {
Self { value: ASTKind::ListView(node), range: None }
}
}
impl From<ASTNodes> for ListItem {
fn from(node: ASTNodes) -> Self {
Self { prefix: Default::default(), rest: node }
}
}