Add the skeletons for the elements.
This commit is contained in:
@@ -3,13 +3,55 @@ use crate::error::CustomError;
|
||||
use super::comment::IComment;
|
||||
use super::keyword::IKeyword;
|
||||
use super::registry::Registry;
|
||||
use super::IBabelCall;
|
||||
use super::ICenterBlock;
|
||||
use super::IClock;
|
||||
use super::ICommentBlock;
|
||||
use super::IDiarySexp;
|
||||
use super::IDrawer;
|
||||
use super::IDynamicBlock;
|
||||
use super::IExampleBlock;
|
||||
use super::IExportBlock;
|
||||
use super::IFixedWidthArea;
|
||||
use super::IFootnoteDefinition;
|
||||
use super::IHorizontalRule;
|
||||
use super::ILatexEnvironment;
|
||||
use super::IParagraph;
|
||||
use super::IPlainList;
|
||||
use super::IPlanning;
|
||||
use super::IPropertyDrawer;
|
||||
use super::IQuoteBlock;
|
||||
use super::ISpecialBlock;
|
||||
use super::ISrcBlock;
|
||||
use super::ITable;
|
||||
use super::IVerseBlock;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum IElement {
|
||||
Paragraph(IParagraph),
|
||||
Keyword(IKeyword),
|
||||
PlainList(IPlainList),
|
||||
CenterBlock(ICenterBlock),
|
||||
QuoteBlock(IQuoteBlock),
|
||||
SpecialBlock(ISpecialBlock),
|
||||
DynamicBlock(IDynamicBlock),
|
||||
FootnoteDefinition(IFootnoteDefinition),
|
||||
Comment(IComment),
|
||||
Drawer(IDrawer),
|
||||
PropertyDrawer(IPropertyDrawer),
|
||||
Table(ITable),
|
||||
VerseBlock(IVerseBlock),
|
||||
CommentBlock(ICommentBlock),
|
||||
ExampleBlock(IExampleBlock),
|
||||
ExportBlock(IExportBlock),
|
||||
SrcBlock(ISrcBlock),
|
||||
Clock(IClock),
|
||||
DiarySexp(IDiarySexp),
|
||||
Planning(IPlanning),
|
||||
FixedWidthArea(IFixedWidthArea),
|
||||
HorizontalRule(IHorizontalRule),
|
||||
Keyword(IKeyword),
|
||||
BabelCall(IBabelCall),
|
||||
LatexEnvironment(ILatexEnvironment),
|
||||
}
|
||||
|
||||
impl IElement {
|
||||
@@ -21,33 +63,75 @@ impl IElement {
|
||||
organic::types::Element::Paragraph(inner) => {
|
||||
Ok(IElement::Paragraph(IParagraph::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::PlainList(_) => todo!(),
|
||||
organic::types::Element::CenterBlock(_) => todo!(),
|
||||
organic::types::Element::QuoteBlock(_) => todo!(),
|
||||
organic::types::Element::SpecialBlock(_) => todo!(),
|
||||
organic::types::Element::DynamicBlock(_) => todo!(),
|
||||
organic::types::Element::FootnoteDefinition(_) => todo!(),
|
||||
organic::types::Element::PlainList(inner) => {
|
||||
Ok(IElement::PlainList(IPlainList::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::CenterBlock(inner) => Ok(IElement::CenterBlock(
|
||||
ICenterBlock::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::QuoteBlock(inner) => Ok(IElement::QuoteBlock(
|
||||
IQuoteBlock::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::SpecialBlock(inner) => Ok(IElement::SpecialBlock(
|
||||
ISpecialBlock::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::DynamicBlock(inner) => Ok(IElement::DynamicBlock(
|
||||
IDynamicBlock::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::FootnoteDefinition(inner) => Ok(IElement::FootnoteDefinition(
|
||||
IFootnoteDefinition::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::Comment(inner) => {
|
||||
Ok(IElement::Comment(IComment::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::Drawer(_) => todo!(),
|
||||
organic::types::Element::PropertyDrawer(_) => todo!(),
|
||||
organic::types::Element::Table(_) => todo!(),
|
||||
organic::types::Element::VerseBlock(_) => todo!(),
|
||||
organic::types::Element::CommentBlock(_) => todo!(),
|
||||
organic::types::Element::ExampleBlock(_) => todo!(),
|
||||
organic::types::Element::ExportBlock(_) => todo!(),
|
||||
organic::types::Element::SrcBlock(_) => todo!(),
|
||||
organic::types::Element::Clock(_) => todo!(),
|
||||
organic::types::Element::DiarySexp(_) => todo!(),
|
||||
organic::types::Element::Planning(_) => todo!(),
|
||||
organic::types::Element::FixedWidthArea(_) => todo!(),
|
||||
organic::types::Element::HorizontalRule(_) => todo!(),
|
||||
organic::types::Element::Drawer(inner) => {
|
||||
Ok(IElement::Drawer(IDrawer::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::PropertyDrawer(inner) => Ok(IElement::PropertyDrawer(
|
||||
IPropertyDrawer::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::Table(inner) => {
|
||||
Ok(IElement::Table(ITable::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::VerseBlock(inner) => Ok(IElement::VerseBlock(
|
||||
IVerseBlock::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::CommentBlock(inner) => Ok(IElement::CommentBlock(
|
||||
ICommentBlock::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::ExampleBlock(inner) => Ok(IElement::ExampleBlock(
|
||||
IExampleBlock::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::ExportBlock(inner) => Ok(IElement::ExportBlock(
|
||||
IExportBlock::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::SrcBlock(inner) => {
|
||||
Ok(IElement::SrcBlock(ISrcBlock::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::Clock(inner) => {
|
||||
Ok(IElement::Clock(IClock::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::DiarySexp(inner) => {
|
||||
Ok(IElement::DiarySexp(IDiarySexp::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::Planning(inner) => {
|
||||
Ok(IElement::Planning(IPlanning::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::FixedWidthArea(inner) => Ok(IElement::FixedWidthArea(
|
||||
IFixedWidthArea::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::HorizontalRule(inner) => Ok(IElement::HorizontalRule(
|
||||
IHorizontalRule::new(registry, inner).await?,
|
||||
)),
|
||||
organic::types::Element::Keyword(inner) => {
|
||||
Ok(IElement::Keyword(IKeyword::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::BabelCall(_) => todo!(),
|
||||
organic::types::Element::LatexEnvironment(_) => todo!(),
|
||||
organic::types::Element::BabelCall(inner) => {
|
||||
Ok(IElement::BabelCall(IBabelCall::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::LatexEnvironment(inner) => Ok(IElement::LatexEnvironment(
|
||||
ILatexEnvironment::new(registry, inner).await?,
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user