Define greater and lesser elements.
This commit is contained in:
parent
66befc66a9
commit
35d60c10ba
7
src/parser/element.rs
Normal file
7
src/parser/element.rs
Normal 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>),
|
||||||
|
}
|
4
src/parser/greater_element.rs
Normal file
4
src/parser/greater_element.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#[derive(Debug)]
|
||||||
|
pub struct PlainList<'s> {
|
||||||
|
pub source: &'s str,
|
||||||
|
}
|
4
src/parser/lesser_element.rs
Normal file
4
src/parser/lesser_element.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Paragraph<'s> {
|
||||||
|
pub source: &'s str,
|
||||||
|
}
|
@ -1,7 +1,10 @@
|
|||||||
mod bold;
|
mod bold;
|
||||||
mod combinator;
|
mod combinator;
|
||||||
mod document;
|
mod document;
|
||||||
|
mod element;
|
||||||
mod error;
|
mod error;
|
||||||
|
mod greater_element;
|
||||||
|
mod lesser_element;
|
||||||
mod link;
|
mod link;
|
||||||
mod list;
|
mod list;
|
||||||
mod object;
|
mod object;
|
||||||
|
@ -2,20 +2,24 @@ pub trait Source<'s> {
|
|||||||
fn get_source(&'s self) -> &'s str;
|
fn get_source(&'s self) -> &'s str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub enum Object<'s> {
|
pub enum Object<'s> {
|
||||||
TextMarkup(TextMarkup<'s>),
|
TextMarkup(TextMarkup<'s>),
|
||||||
PlainText(PlainText<'s>),
|
PlainText(PlainText<'s>),
|
||||||
RegularLink(RegularLink<'s>),
|
RegularLink(RegularLink<'s>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct TextMarkup<'s> {
|
pub struct TextMarkup<'s> {
|
||||||
pub source: &'s str,
|
pub source: &'s str,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct PlainText<'s> {
|
pub struct PlainText<'s> {
|
||||||
pub source: &'s str,
|
pub source: &'s str,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct RegularLink<'s> {
|
pub struct RegularLink<'s> {
|
||||||
pub source: &'s str,
|
pub source: &'s str,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user