Fix lifetimes in the compare functions.

This commit is contained in:
Tom Alexander
2023-10-02 12:36:09 -04:00
parent c0555dec0b
commit ecd523fa8f
4 changed files with 163 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
use std::borrow::Cow;
use crate::iter::AstNode;
use crate::types::AngleLink;
use crate::types::BabelCall;
use crate::types::Bold;
@@ -73,6 +74,69 @@ impl<'s, I: ElispFact<'s>> GetElispFact<'s> for I {
}
}
impl<'r, 's> GetElispFact<'s> for AstNode<'r, 's> {
fn get_elisp_fact<'b>(&'b self) -> &'b dyn ElispFact<'s> {
match self {
AstNode::Document(_) => todo!(),
AstNode::Heading(_) => todo!(),
AstNode::Section(_) => todo!(),
AstNode::Paragraph(_) => todo!(),
AstNode::PlainList(_) => todo!(),
AstNode::PlainListItem(_) => todo!(),
AstNode::GreaterBlock(_) => todo!(),
AstNode::DynamicBlock(_) => todo!(),
AstNode::FootnoteDefinition(_) => todo!(),
AstNode::Comment(_) => todo!(),
AstNode::Drawer(_) => todo!(),
AstNode::PropertyDrawer(_) => todo!(),
AstNode::NodeProperty(_) => todo!(),
AstNode::Table(_) => todo!(),
AstNode::TableRow(_) => todo!(),
AstNode::VerseBlock(_) => todo!(),
AstNode::CommentBlock(_) => todo!(),
AstNode::ExampleBlock(_) => todo!(),
AstNode::ExportBlock(_) => todo!(),
AstNode::SrcBlock(_) => todo!(),
AstNode::Clock(_) => todo!(),
AstNode::DiarySexp(_) => todo!(),
AstNode::Planning(_) => todo!(),
AstNode::FixedWidthArea(_) => todo!(),
AstNode::HorizontalRule(_) => todo!(),
AstNode::Keyword(_) => todo!(),
AstNode::BabelCall(_) => todo!(),
AstNode::LatexEnvironment(_) => todo!(),
AstNode::Bold(_) => todo!(),
AstNode::Italic(_) => todo!(),
AstNode::Underline(_) => todo!(),
AstNode::StrikeThrough(_) => todo!(),
AstNode::Code(_) => todo!(),
AstNode::Verbatim(_) => todo!(),
AstNode::PlainText(_) => todo!(),
AstNode::RegularLink(_) => todo!(),
AstNode::RadioLink(_) => todo!(),
AstNode::RadioTarget(_) => todo!(),
AstNode::PlainLink(_) => todo!(),
AstNode::AngleLink(_) => todo!(),
AstNode::OrgMacro(_) => todo!(),
AstNode::Entity(_) => todo!(),
AstNode::LatexFragment(_) => todo!(),
AstNode::ExportSnippet(_) => todo!(),
AstNode::FootnoteReference(_) => todo!(),
AstNode::Citation(_) => todo!(),
AstNode::CitationReference(_) => todo!(),
AstNode::InlineBabelCall(_) => todo!(),
AstNode::InlineSourceBlock(_) => todo!(),
AstNode::LineBreak(_) => todo!(),
AstNode::Target(_) => todo!(),
AstNode::StatisticsCookie(_) => todo!(),
AstNode::Subscript(_) => todo!(),
AstNode::Superscript(_) => todo!(),
AstNode::TableCell(_) => todo!(),
AstNode::Timestamp(inner) => *inner,
}
}
}
impl<'s> GetElispFact<'s> for Element<'s> {
fn get_elisp_fact<'b>(&'b self) -> &'b dyn ElispFact<'s> {
match self {