
This is currently just to maintain consistency with the render phase's RenderContext but in the future it should allow us to include immutable data that is not locked behind the ArcMutex.
187 lines
5.2 KiB
Rust
187 lines
5.2 KiB
Rust
use crate::error::CustomError;
|
|
use crate::intermediate::macros::iitem;
|
|
|
|
use super::angle_link::IAngleLink;
|
|
use super::bold::IBold;
|
|
use super::citation::ICitation;
|
|
use super::citation_reference::ICitationReference;
|
|
use super::code::ICode;
|
|
use super::entity::IEntity;
|
|
use super::export_snippet::IExportSnippet;
|
|
use super::footnote_reference::IFootnoteReference;
|
|
use super::inline_babel_call::IInlineBabelCall;
|
|
use super::inline_source_block::IInlineSourceBlock;
|
|
use super::italic::IItalic;
|
|
use super::latex_fragment::ILatexFragment;
|
|
use super::line_break::ILineBreak;
|
|
use super::macros::iselector;
|
|
use super::org_macro::IOrgMacro;
|
|
use super::plain_link::IPlainLink;
|
|
use super::plain_text::IPlainText;
|
|
use super::radio_link::IRadioLink;
|
|
use super::radio_target::IRadioTarget;
|
|
|
|
use super::regular_link::IRegularLink;
|
|
use super::statistics_cookie::IStatisticsCookie;
|
|
use super::strike_through::IStrikeThrough;
|
|
use super::subscript::ISubscript;
|
|
use super::superscript::ISuperscript;
|
|
use super::timestamp::ITimestamp;
|
|
use super::underline::IUnderline;
|
|
use super::verbatim::IVerbatim;
|
|
use super::ITarget;
|
|
use futures::future::{BoxFuture, FutureExt};
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub(crate) enum IObject {
|
|
Bold(IBold),
|
|
Italic(IItalic),
|
|
Underline(IUnderline),
|
|
StrikeThrough(IStrikeThrough),
|
|
Code(ICode),
|
|
Verbatim(IVerbatim),
|
|
PlainText(IPlainText),
|
|
RegularLink(IRegularLink),
|
|
RadioLink(IRadioLink),
|
|
RadioTarget(IRadioTarget),
|
|
PlainLink(IPlainLink),
|
|
AngleLink(IAngleLink),
|
|
OrgMacro(IOrgMacro),
|
|
Entity(IEntity),
|
|
LatexFragment(ILatexFragment),
|
|
ExportSnippet(IExportSnippet),
|
|
FootnoteReference(IFootnoteReference),
|
|
Citation(ICitation),
|
|
CitationReference(ICitationReference),
|
|
InlineBabelCall(IInlineBabelCall),
|
|
InlineSourceBlock(IInlineSourceBlock),
|
|
LineBreak(ILineBreak),
|
|
Target(ITarget),
|
|
StatisticsCookie(IStatisticsCookie),
|
|
Subscript(ISubscript),
|
|
Superscript(ISuperscript),
|
|
Timestamp(ITimestamp),
|
|
}
|
|
|
|
iselector!(IObject, Object, original, intermediate_context, {
|
|
iitem!(
|
|
intermediate_context,
|
|
original,
|
|
(organic::types::Object::Bold, IObject::Bold, IBold),
|
|
(organic::types::Object::Italic, IObject::Italic, IItalic),
|
|
(
|
|
organic::types::Object::Underline,
|
|
IObject::Underline,
|
|
IUnderline
|
|
),
|
|
(
|
|
organic::types::Object::StrikeThrough,
|
|
IObject::StrikeThrough,
|
|
IStrikeThrough
|
|
),
|
|
(organic::types::Object::Code, IObject::Code, ICode),
|
|
(
|
|
organic::types::Object::Verbatim,
|
|
IObject::Verbatim,
|
|
IVerbatim
|
|
),
|
|
(
|
|
organic::types::Object::PlainText,
|
|
IObject::PlainText,
|
|
IPlainText
|
|
),
|
|
(
|
|
organic::types::Object::RegularLink,
|
|
IObject::RegularLink,
|
|
IRegularLink
|
|
),
|
|
(
|
|
organic::types::Object::RadioLink,
|
|
IObject::RadioLink,
|
|
IRadioLink
|
|
),
|
|
(
|
|
organic::types::Object::RadioTarget,
|
|
IObject::RadioTarget,
|
|
IRadioTarget
|
|
),
|
|
(
|
|
organic::types::Object::PlainLink,
|
|
IObject::PlainLink,
|
|
IPlainLink
|
|
),
|
|
(
|
|
organic::types::Object::AngleLink,
|
|
IObject::AngleLink,
|
|
IAngleLink
|
|
),
|
|
(
|
|
organic::types::Object::OrgMacro,
|
|
IObject::OrgMacro,
|
|
IOrgMacro
|
|
),
|
|
(organic::types::Object::Entity, IObject::Entity, IEntity),
|
|
(
|
|
organic::types::Object::LatexFragment,
|
|
IObject::LatexFragment,
|
|
ILatexFragment
|
|
),
|
|
(
|
|
organic::types::Object::ExportSnippet,
|
|
IObject::ExportSnippet,
|
|
IExportSnippet
|
|
),
|
|
(
|
|
organic::types::Object::FootnoteReference,
|
|
IObject::FootnoteReference,
|
|
IFootnoteReference
|
|
),
|
|
(
|
|
organic::types::Object::Citation,
|
|
IObject::Citation,
|
|
ICitation
|
|
),
|
|
(
|
|
organic::types::Object::CitationReference,
|
|
IObject::CitationReference,
|
|
ICitationReference
|
|
),
|
|
(
|
|
organic::types::Object::InlineBabelCall,
|
|
IObject::InlineBabelCall,
|
|
IInlineBabelCall
|
|
),
|
|
(
|
|
organic::types::Object::InlineSourceBlock,
|
|
IObject::InlineSourceBlock,
|
|
IInlineSourceBlock
|
|
),
|
|
(
|
|
organic::types::Object::LineBreak,
|
|
IObject::LineBreak,
|
|
ILineBreak
|
|
),
|
|
(organic::types::Object::Target, IObject::Target, ITarget),
|
|
(
|
|
organic::types::Object::StatisticsCookie,
|
|
IObject::StatisticsCookie,
|
|
IStatisticsCookie
|
|
),
|
|
(
|
|
organic::types::Object::Subscript,
|
|
IObject::Subscript,
|
|
ISubscript
|
|
),
|
|
(
|
|
organic::types::Object::Superscript,
|
|
IObject::Superscript,
|
|
ISuperscript
|
|
),
|
|
(
|
|
organic::types::Object::Timestamp,
|
|
IObject::Timestamp,
|
|
ITimestamp
|
|
),
|
|
)
|
|
});
|