Define greater and lesser elements.

This commit is contained in:
Tom Alexander 2023-03-23 17:26:07 -04:00
parent 66befc66a9
commit 35d60c10ba
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
5 changed files with 22 additions and 0 deletions

7
src/parser/element.rs Normal file
View File

@ -0,0 +1,7 @@
use super::greater_element::PlainList;
use super::lesser_element::Paragraph;
pub enum Element<'s> {
Paragraph(Paragraph<'s>),
PlainList(PlainList<'s>),
}

View File

@ -0,0 +1,4 @@
#[derive(Debug)]
pub struct PlainList<'s> {
pub source: &'s str,
}

View File

@ -0,0 +1,4 @@
#[derive(Debug)]
pub struct Paragraph<'s> {
pub source: &'s str,
}

View File

@ -1,7 +1,10 @@
mod bold;
mod combinator;
mod document;
mod element;
mod error;
mod greater_element;
mod lesser_element;
mod link;
mod list;
mod object;

View File

@ -2,20 +2,24 @@ pub trait Source<'s> {
fn get_source(&'s self) -> &'s str;
}
#[derive(Debug)]
pub enum Object<'s> {
TextMarkup(TextMarkup<'s>),
PlainText(PlainText<'s>),
RegularLink(RegularLink<'s>),
}
#[derive(Debug)]
pub struct TextMarkup<'s> {
pub source: &'s str,
}
#[derive(Debug)]
pub struct PlainText<'s> {
pub source: &'s str,
}
#[derive(Debug)]
pub struct RegularLink<'s> {
pub source: &'s str,
}