Move the structs into the token module.
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
use super::text::Paragraph;
|
||||
use super::text::TextElement;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Token<'a> {
|
||||
TextElement(TextElement<'a>),
|
||||
@@ -18,3 +15,59 @@ impl<'a> Into<Token<'a>> for Paragraph<'a> {
|
||||
Token::Paragraph(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum TextElement<'a> {
|
||||
Span(Span<'a>),
|
||||
Space(Space<'a>),
|
||||
LineBreak(LineBreak<'a>),
|
||||
Symbol(Symbol<'a>),
|
||||
Bold(Bold<'a>),
|
||||
Link(Link<'a>),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Span<'a> {
|
||||
pub contents: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Space<'a> {
|
||||
pub contents: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct LineBreak<'a> {
|
||||
pub contents: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Symbol<'a> {
|
||||
pub contents: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct BlankLine<'a> {
|
||||
pub contents: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Sequence<'a> {
|
||||
pub contents: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Bold<'a> {
|
||||
pub contents: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Link<'a> {
|
||||
pub contents: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Paragraph<'a> {
|
||||
pub contents: Vec<TextElement<'a>>,
|
||||
pub paragraph_end: &'a str,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user