natter/src/intermediate/object.rs

49 lines
2.1 KiB
Rust
Raw Normal View History

use crate::error::CustomError;
use super::plain_text::IPlainText;
use super::registry::Registry;
#[derive(Debug)]
pub(crate) enum IObject {
PlainText(IPlainText),
}
impl IObject {
pub(crate) fn new(
registry: &mut Registry<'_>,
obj: &organic::types::Object<'_>,
) -> Result<IObject, CustomError> {
match obj {
organic::types::Object::Bold(_) => todo!(),
organic::types::Object::Italic(_) => todo!(),
organic::types::Object::Underline(_) => todo!(),
organic::types::Object::StrikeThrough(_) => todo!(),
organic::types::Object::Code(_) => todo!(),
organic::types::Object::Verbatim(_) => todo!(),
organic::types::Object::PlainText(plain_text) => {
Ok(IObject::PlainText(IPlainText::new(registry, plain_text)?))
}
organic::types::Object::RegularLink(_) => todo!(),
organic::types::Object::RadioLink(_) => todo!(),
organic::types::Object::RadioTarget(_) => todo!(),
organic::types::Object::PlainLink(_) => todo!(),
organic::types::Object::AngleLink(_) => todo!(),
organic::types::Object::OrgMacro(_) => todo!(),
organic::types::Object::Entity(_) => todo!(),
organic::types::Object::LatexFragment(_) => todo!(),
organic::types::Object::ExportSnippet(_) => todo!(),
organic::types::Object::FootnoteReference(_) => todo!(),
organic::types::Object::Citation(_) => todo!(),
organic::types::Object::CitationReference(_) => todo!(),
organic::types::Object::InlineBabelCall(_) => todo!(),
organic::types::Object::InlineSourceBlock(_) => todo!(),
organic::types::Object::LineBreak(_) => todo!(),
organic::types::Object::Target(_) => todo!(),
organic::types::Object::StatisticsCookie(_) => todo!(),
organic::types::Object::Subscript(_) => todo!(),
organic::types::Object::Superscript(_) => todo!(),
organic::types::Object::Timestamp(_) => todo!(),
}
}
}