lex_core/lex/ast/elements/inlines/
references.rs1#[derive(Debug, Clone, PartialEq)]
9pub struct ReferenceInline {
10 pub raw: String,
11 pub reference_type: ReferenceType,
12}
13
14impl ReferenceInline {
15 pub fn new(raw: String) -> Self {
16 Self {
17 raw,
18 reference_type: ReferenceType::NotSure,
19 }
20 }
21}
22
23#[derive(Debug, Clone, PartialEq)]
25pub enum ReferenceType {
26 ToCome { identifier: Option<String> },
28 Citation(CitationData),
30 FootnoteLabeled { label: String },
32 FootnoteNumber { number: u32 },
34 Session { target: String },
36 Url { target: String },
38 File { target: String },
40 General { target: String },
42 NotSure,
44}
45
46#[derive(Debug, Clone, PartialEq)]
48pub struct CitationData {
49 pub keys: Vec<String>,
50 pub locator: Option<CitationLocator>,
51}
52
53#[derive(Debug, Clone, PartialEq)]
55pub struct CitationLocator {
56 pub format: PageFormat,
57 pub ranges: Vec<PageRange>,
58 pub raw: String,
60}
61
62#[derive(Debug, Clone, PartialEq)]
63pub enum PageFormat {
64 P,
65 Pp,
66}
67
68#[derive(Debug, Clone, PartialEq)]
69pub struct PageRange {
70 pub start: u32,
71 pub end: Option<u32>,
72}