just/src/compilation.rs
2023-11-21 11:28:59 -08:00

20 lines
451 B
Rust

use super::*;
#[derive(Debug)]
pub(crate) struct Compilation<'src> {
pub(crate) asts: HashMap<PathBuf, Ast<'src>>,
pub(crate) justfile: Justfile<'src>,
pub(crate) root: PathBuf,
pub(crate) srcs: HashMap<PathBuf, &'src str>,
}
impl<'src> Compilation<'src> {
pub(crate) fn root_ast(&self) -> &Ast<'src> {
self.asts.get(&self.root).unwrap()
}
pub(crate) fn root_src(&self) -> &'src str {
self.srcs.get(&self.root).unwrap()
}
}