Skip to main content

locus_core_rs/parsing/
ast.rs

1use super::lexicon::LayerKind;
2
3#[derive(Debug, Clone)]
4pub struct AstLayer {
5    pub kind: LayerKind,
6    pub source: String,
7    pub start: usize,
8    pub end: usize,
9}
10
11#[derive(Debug, Clone, Default)]
12pub struct SttpAst {
13    pub provenance: Option<AstLayer>,
14    pub envelope: Option<AstLayer>,
15    pub content: Option<AstLayer>,
16    pub metrics: Option<AstLayer>,
17    pub strict_spine: bool,
18}
19
20impl SttpAst {
21    pub fn with_strict_spine(mut self, strict_spine: bool) -> Self {
22        self.strict_spine = strict_spine;
23        self
24    }
25}