Skip to main content

presolve_compiler/
semantic_provenance.rs

1use std::path::{Path, PathBuf};
2
3use presolve_parser::SourceSpan;
4
5/// Compiler source location for a semantic entity or relationship.
6#[derive(Debug, Clone, PartialEq, Eq)]
7pub struct SourceProvenance {
8    pub path: PathBuf,
9    pub span: SourceSpan,
10}
11
12impl SourceProvenance {
13    #[must_use]
14    pub fn new(path: impl AsRef<Path>, span: SourceSpan) -> Self {
15        Self {
16            path: path.as_ref().to_path_buf(),
17            span,
18        }
19    }
20}