2023-09-27 14:24:08 -04:00
|
|
|
use crate::types::AngleLink;
|
|
|
|
use crate::types::BabelCall;
|
|
|
|
use crate::types::Bold;
|
|
|
|
use crate::types::Citation;
|
|
|
|
use crate::types::CitationReference;
|
|
|
|
use crate::types::Clock;
|
|
|
|
use crate::types::Code;
|
|
|
|
use crate::types::Comment;
|
|
|
|
use crate::types::CommentBlock;
|
|
|
|
use crate::types::DiarySexp;
|
|
|
|
use crate::types::Document;
|
|
|
|
use crate::types::Drawer;
|
|
|
|
use crate::types::DynamicBlock;
|
2023-09-27 15:07:26 -04:00
|
|
|
use crate::types::Element;
|
2023-09-27 14:24:08 -04:00
|
|
|
use crate::types::Entity;
|
|
|
|
use crate::types::ExampleBlock;
|
|
|
|
use crate::types::ExportBlock;
|
|
|
|
use crate::types::ExportSnippet;
|
|
|
|
use crate::types::FixedWidthArea;
|
|
|
|
use crate::types::FootnoteDefinition;
|
|
|
|
use crate::types::FootnoteReference;
|
|
|
|
use crate::types::GreaterBlock;
|
|
|
|
use crate::types::Heading;
|
|
|
|
use crate::types::HorizontalRule;
|
|
|
|
use crate::types::InlineBabelCall;
|
|
|
|
use crate::types::InlineSourceBlock;
|
|
|
|
use crate::types::Italic;
|
|
|
|
use crate::types::Keyword;
|
|
|
|
use crate::types::LatexEnvironment;
|
|
|
|
use crate::types::LatexFragment;
|
|
|
|
use crate::types::LineBreak;
|
2023-09-27 15:07:26 -04:00
|
|
|
use crate::types::Object;
|
2023-09-27 14:24:08 -04:00
|
|
|
use crate::types::OrgMacro;
|
|
|
|
use crate::types::Paragraph;
|
|
|
|
use crate::types::PlainLink;
|
|
|
|
use crate::types::PlainList;
|
|
|
|
use crate::types::PlainText;
|
|
|
|
use crate::types::Planning;
|
|
|
|
use crate::types::PropertyDrawer;
|
|
|
|
use crate::types::RadioLink;
|
|
|
|
use crate::types::RadioTarget;
|
|
|
|
use crate::types::RegularLink;
|
|
|
|
use crate::types::Section;
|
|
|
|
use crate::types::SrcBlock;
|
|
|
|
use crate::types::StatisticsCookie;
|
|
|
|
use crate::types::StrikeThrough;
|
|
|
|
use crate::types::Subscript;
|
|
|
|
use crate::types::Superscript;
|
|
|
|
use crate::types::Table;
|
|
|
|
use crate::types::Target;
|
|
|
|
use crate::types::Timestamp;
|
|
|
|
use crate::types::Underline;
|
|
|
|
use crate::types::Verbatim;
|
|
|
|
use crate::types::VerseBlock;
|
2023-09-27 13:48:17 -04:00
|
|
|
|
2023-09-27 14:24:08 -04:00
|
|
|
pub enum AstNode<'r, 's> {
|
|
|
|
// Document Nodes
|
|
|
|
Document(&'r Document<'s>),
|
|
|
|
Heading(&'r Heading<'s>),
|
|
|
|
Section(&'r Section<'s>),
|
|
|
|
// Elements
|
|
|
|
Paragraph(&'r Paragraph<'s>),
|
|
|
|
PlainList(&'r PlainList<'s>),
|
|
|
|
GreaterBlock(&'r GreaterBlock<'s>),
|
|
|
|
DynamicBlock(&'r DynamicBlock<'s>),
|
|
|
|
FootnoteDefinition(&'r FootnoteDefinition<'s>),
|
|
|
|
Comment(&'r Comment<'s>),
|
|
|
|
Drawer(&'r Drawer<'s>),
|
|
|
|
PropertyDrawer(&'r PropertyDrawer<'s>),
|
|
|
|
Table(&'r Table<'s>),
|
|
|
|
VerseBlock(&'r VerseBlock<'s>),
|
|
|
|
CommentBlock(&'r CommentBlock<'s>),
|
|
|
|
ExampleBlock(&'r ExampleBlock<'s>),
|
|
|
|
ExportBlock(&'r ExportBlock<'s>),
|
|
|
|
SrcBlock(&'r SrcBlock<'s>),
|
|
|
|
Clock(&'r Clock<'s>),
|
|
|
|
DiarySexp(&'r DiarySexp<'s>),
|
|
|
|
Planning(&'r Planning<'s>),
|
|
|
|
FixedWidthArea(&'r FixedWidthArea<'s>),
|
|
|
|
HorizontalRule(&'r HorizontalRule<'s>),
|
|
|
|
Keyword(&'r Keyword<'s>),
|
|
|
|
BabelCall(&'r BabelCall<'s>),
|
|
|
|
LatexEnvironment(&'r LatexEnvironment<'s>),
|
|
|
|
// Objects
|
|
|
|
Bold(&'r Bold<'s>),
|
|
|
|
Italic(&'r Italic<'s>),
|
|
|
|
Underline(&'r Underline<'s>),
|
|
|
|
StrikeThrough(&'r StrikeThrough<'s>),
|
|
|
|
Code(&'r Code<'s>),
|
|
|
|
Verbatim(&'r Verbatim<'s>),
|
|
|
|
PlainText(&'r PlainText<'s>),
|
|
|
|
RegularLink(&'r RegularLink<'s>),
|
|
|
|
RadioLink(&'r RadioLink<'s>),
|
|
|
|
RadioTarget(&'r RadioTarget<'s>),
|
|
|
|
PlainLink(&'r PlainLink<'s>),
|
|
|
|
AngleLink(&'r AngleLink<'s>),
|
|
|
|
OrgMacro(&'r OrgMacro<'s>),
|
|
|
|
Entity(&'r Entity<'s>),
|
|
|
|
LatexFragment(&'r LatexFragment<'s>),
|
|
|
|
ExportSnippet(&'r ExportSnippet<'s>),
|
|
|
|
FootnoteReference(&'r FootnoteReference<'s>),
|
|
|
|
Citation(&'r Citation<'s>),
|
|
|
|
CitationReference(&'r CitationReference<'s>),
|
|
|
|
InlineBabelCall(&'r InlineBabelCall<'s>),
|
|
|
|
InlineSourceBlock(&'r InlineSourceBlock<'s>),
|
|
|
|
LineBreak(&'r LineBreak<'s>),
|
|
|
|
Target(&'r Target<'s>),
|
|
|
|
StatisticsCookie(&'r StatisticsCookie<'s>),
|
|
|
|
Subscript(&'r Subscript<'s>),
|
|
|
|
Superscript(&'r Superscript<'s>),
|
|
|
|
Timestamp(&'r Timestamp<'s>),
|
|
|
|
}
|
2023-09-27 15:07:26 -04:00
|
|
|
|
|
|
|
impl<'r, 's> From<&'r Element<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Element<'s>) -> Self {
|
|
|
|
match value {
|
|
|
|
Element::Paragraph(inner) => inner.into(),
|
|
|
|
Element::PlainList(inner) => inner.into(),
|
|
|
|
Element::GreaterBlock(inner) => inner.into(),
|
|
|
|
Element::DynamicBlock(inner) => inner.into(),
|
|
|
|
Element::FootnoteDefinition(inner) => inner.into(),
|
|
|
|
Element::Comment(inner) => inner.into(),
|
|
|
|
Element::Drawer(inner) => inner.into(),
|
|
|
|
Element::PropertyDrawer(inner) => inner.into(),
|
|
|
|
Element::Table(inner) => inner.into(),
|
|
|
|
Element::VerseBlock(inner) => inner.into(),
|
|
|
|
Element::CommentBlock(inner) => inner.into(),
|
|
|
|
Element::ExampleBlock(inner) => inner.into(),
|
|
|
|
Element::ExportBlock(inner) => inner.into(),
|
|
|
|
Element::SrcBlock(inner) => inner.into(),
|
|
|
|
Element::Clock(inner) => inner.into(),
|
|
|
|
Element::DiarySexp(inner) => inner.into(),
|
|
|
|
Element::Planning(inner) => inner.into(),
|
|
|
|
Element::FixedWidthArea(inner) => inner.into(),
|
|
|
|
Element::HorizontalRule(inner) => inner.into(),
|
|
|
|
Element::Keyword(inner) => inner.into(),
|
|
|
|
Element::BabelCall(inner) => inner.into(),
|
|
|
|
Element::LatexEnvironment(inner) => inner.into(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'r, 's> From<&'r Object<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Object<'s>) -> Self {
|
|
|
|
match value {
|
|
|
|
Object::Bold(inner) => inner.into(),
|
|
|
|
Object::Italic(inner) => inner.into(),
|
|
|
|
Object::Underline(inner) => inner.into(),
|
|
|
|
Object::StrikeThrough(inner) => inner.into(),
|
|
|
|
Object::Code(inner) => inner.into(),
|
|
|
|
Object::Verbatim(inner) => inner.into(),
|
|
|
|
Object::PlainText(inner) => inner.into(),
|
|
|
|
Object::RegularLink(inner) => inner.into(),
|
|
|
|
Object::RadioLink(inner) => inner.into(),
|
|
|
|
Object::RadioTarget(inner) => inner.into(),
|
|
|
|
Object::PlainLink(inner) => inner.into(),
|
|
|
|
Object::AngleLink(inner) => inner.into(),
|
|
|
|
Object::OrgMacro(inner) => inner.into(),
|
|
|
|
Object::Entity(inner) => inner.into(),
|
|
|
|
Object::LatexFragment(inner) => inner.into(),
|
|
|
|
Object::ExportSnippet(inner) => inner.into(),
|
|
|
|
Object::FootnoteReference(inner) => inner.into(),
|
|
|
|
Object::Citation(inner) => inner.into(),
|
|
|
|
Object::CitationReference(inner) => inner.into(),
|
|
|
|
Object::InlineBabelCall(inner) => inner.into(),
|
|
|
|
Object::InlineSourceBlock(inner) => inner.into(),
|
|
|
|
Object::LineBreak(inner) => inner.into(),
|
|
|
|
Object::Target(inner) => inner.into(),
|
|
|
|
Object::StatisticsCookie(inner) => inner.into(),
|
|
|
|
Object::Subscript(inner) => inner.into(),
|
|
|
|
Object::Superscript(inner) => inner.into(),
|
|
|
|
Object::Timestamp(inner) => inner.into(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'r, 's> From<&'r Document<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Document<'s>) -> Self {
|
|
|
|
AstNode::Document(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Heading<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Heading<'s>) -> Self {
|
|
|
|
AstNode::Heading(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Section<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Section<'s>) -> Self {
|
|
|
|
AstNode::Section(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Paragraph<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Paragraph<'s>) -> Self {
|
|
|
|
AstNode::Paragraph(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r PlainList<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r PlainList<'s>) -> Self {
|
|
|
|
AstNode::PlainList(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r GreaterBlock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r GreaterBlock<'s>) -> Self {
|
|
|
|
AstNode::GreaterBlock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r DynamicBlock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r DynamicBlock<'s>) -> Self {
|
|
|
|
AstNode::DynamicBlock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r FootnoteDefinition<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r FootnoteDefinition<'s>) -> Self {
|
|
|
|
AstNode::FootnoteDefinition(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Comment<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Comment<'s>) -> Self {
|
|
|
|
AstNode::Comment(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Drawer<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Drawer<'s>) -> Self {
|
|
|
|
AstNode::Drawer(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r PropertyDrawer<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r PropertyDrawer<'s>) -> Self {
|
|
|
|
AstNode::PropertyDrawer(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Table<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Table<'s>) -> Self {
|
|
|
|
AstNode::Table(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r VerseBlock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r VerseBlock<'s>) -> Self {
|
|
|
|
AstNode::VerseBlock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r CommentBlock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r CommentBlock<'s>) -> Self {
|
|
|
|
AstNode::CommentBlock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r ExampleBlock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r ExampleBlock<'s>) -> Self {
|
|
|
|
AstNode::ExampleBlock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r ExportBlock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r ExportBlock<'s>) -> Self {
|
|
|
|
AstNode::ExportBlock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r SrcBlock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r SrcBlock<'s>) -> Self {
|
|
|
|
AstNode::SrcBlock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Clock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Clock<'s>) -> Self {
|
|
|
|
AstNode::Clock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r DiarySexp<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r DiarySexp<'s>) -> Self {
|
|
|
|
AstNode::DiarySexp(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Planning<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Planning<'s>) -> Self {
|
|
|
|
AstNode::Planning(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r FixedWidthArea<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r FixedWidthArea<'s>) -> Self {
|
|
|
|
AstNode::FixedWidthArea(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r HorizontalRule<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r HorizontalRule<'s>) -> Self {
|
|
|
|
AstNode::HorizontalRule(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Keyword<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Keyword<'s>) -> Self {
|
|
|
|
AstNode::Keyword(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r BabelCall<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r BabelCall<'s>) -> Self {
|
|
|
|
AstNode::BabelCall(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r LatexEnvironment<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r LatexEnvironment<'s>) -> Self {
|
|
|
|
AstNode::LatexEnvironment(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Bold<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Bold<'s>) -> Self {
|
|
|
|
AstNode::Bold(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Italic<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Italic<'s>) -> Self {
|
|
|
|
AstNode::Italic(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Underline<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Underline<'s>) -> Self {
|
|
|
|
AstNode::Underline(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r StrikeThrough<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r StrikeThrough<'s>) -> Self {
|
|
|
|
AstNode::StrikeThrough(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Code<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Code<'s>) -> Self {
|
|
|
|
AstNode::Code(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Verbatim<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Verbatim<'s>) -> Self {
|
|
|
|
AstNode::Verbatim(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r PlainText<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r PlainText<'s>) -> Self {
|
|
|
|
AstNode::PlainText(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r RegularLink<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r RegularLink<'s>) -> Self {
|
|
|
|
AstNode::RegularLink(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r RadioLink<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r RadioLink<'s>) -> Self {
|
|
|
|
AstNode::RadioLink(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r RadioTarget<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r RadioTarget<'s>) -> Self {
|
|
|
|
AstNode::RadioTarget(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r PlainLink<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r PlainLink<'s>) -> Self {
|
|
|
|
AstNode::PlainLink(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r AngleLink<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r AngleLink<'s>) -> Self {
|
|
|
|
AstNode::AngleLink(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r OrgMacro<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r OrgMacro<'s>) -> Self {
|
|
|
|
AstNode::OrgMacro(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Entity<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Entity<'s>) -> Self {
|
|
|
|
AstNode::Entity(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r LatexFragment<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r LatexFragment<'s>) -> Self {
|
|
|
|
AstNode::LatexFragment(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r ExportSnippet<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r ExportSnippet<'s>) -> Self {
|
|
|
|
AstNode::ExportSnippet(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r FootnoteReference<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r FootnoteReference<'s>) -> Self {
|
|
|
|
AstNode::FootnoteReference(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Citation<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Citation<'s>) -> Self {
|
|
|
|
AstNode::Citation(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r CitationReference<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r CitationReference<'s>) -> Self {
|
|
|
|
AstNode::CitationReference(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r InlineBabelCall<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r InlineBabelCall<'s>) -> Self {
|
|
|
|
AstNode::InlineBabelCall(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r InlineSourceBlock<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r InlineSourceBlock<'s>) -> Self {
|
|
|
|
AstNode::InlineSourceBlock(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r LineBreak<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r LineBreak<'s>) -> Self {
|
|
|
|
AstNode::LineBreak(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Target<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Target<'s>) -> Self {
|
|
|
|
AstNode::Target(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r StatisticsCookie<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r StatisticsCookie<'s>) -> Self {
|
|
|
|
AstNode::StatisticsCookie(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Subscript<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Subscript<'s>) -> Self {
|
|
|
|
AstNode::Subscript(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Superscript<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Superscript<'s>) -> Self {
|
|
|
|
AstNode::Superscript(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl<'r, 's> From<&'r Timestamp<'s>> for AstNode<'r, 's> {
|
|
|
|
fn from(value: &'r Timestamp<'s>) -> Self {
|
|
|
|
AstNode::Timestamp(value)
|
|
|
|
}
|
|
|
|
}
|