Create structure for inline babel calls.

This commit is contained in:
Tom Alexander
2023-07-21 19:53:02 -04:00
parent 1e2ea17a9c
commit eef2944307
5 changed files with 54 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ pub enum Object<'s> {
FootnoteReference(FootnoteReference<'s>),
Citation(Citation<'s>),
CitationReference(CitationReference<'s>),
InlineBabelCall(InlineBabelCall<'s>),
}
#[derive(Debug, PartialEq)]
@@ -137,6 +138,11 @@ pub struct CitationReference<'s> {
pub source: &'s str,
}
#[derive(Debug, PartialEq)]
pub struct InlineBabelCall<'s> {
pub source: &'s str,
}
impl<'s> Source<'s> for Object<'s> {
fn get_source(&'s self) -> &'s str {
match self {
@@ -159,6 +165,7 @@ impl<'s> Source<'s> for Object<'s> {
Object::FootnoteReference(obj) => obj.source,
Object::Citation(obj) => obj.source,
Object::CitationReference(obj) => obj.source,
Object::InlineBabelCall(obj) => obj.source,
}
}
}
@@ -270,3 +277,9 @@ impl<'s> Source<'s> for CitationReference<'s> {
self.source
}
}
impl<'s> Source<'s> for InlineBabelCall<'s> {
fn get_source(&'s self) -> &'s str {
self.source
}
}