diff options
author | Nadrieril | 2020-03-18 18:58:51 +0000 |
---|---|---|
committer | Nadrieril | 2020-03-31 21:44:01 +0100 |
commit | 7848c8e8d3147ebe428290558aa6c0efcbf59ee5 (patch) | |
tree | be25355f0fabf6bc5f9b0568e224795058f069a6 /dhall/src/semantics/resolve | |
parent | 844dc3defdd7735742ad41eb6d1da8fe2e7f340b (diff) |
Brutally make all of dhall pub
Diffstat (limited to 'dhall/src/semantics/resolve')
-rw-r--r-- | dhall/src/semantics/resolve/env.rs | 8 | ||||
-rw-r--r-- | dhall/src/semantics/resolve/hir.rs | 8 | ||||
-rw-r--r-- | dhall/src/semantics/resolve/mod.rs | 6 | ||||
-rw-r--r-- | dhall/src/semantics/resolve/resolve.rs | 10 |
4 files changed, 16 insertions, 16 deletions
diff --git a/dhall/src/semantics/resolve/env.rs b/dhall/src/semantics/resolve/env.rs index fe8c178..d5bb15b 100644 --- a/dhall/src/semantics/resolve/env.rs +++ b/dhall/src/semantics/resolve/env.rs @@ -6,16 +6,16 @@ use crate::syntax::{Label, V}; /// Environment for resolving names. #[derive(Debug, Clone)] -pub(crate) struct NameEnv { +pub struct NameEnv { names: Vec<Label>, } -pub(crate) type ImportCache = HashMap<ImportLocation, TypedHir>; -pub(crate) type ImportStack = Vec<ImportLocation>; +pub type ImportCache = HashMap<ImportLocation, TypedHir>; +pub type ImportStack = Vec<ImportLocation>; /// Environment for resolving imports #[derive(Debug, Clone)] -pub(crate) struct ImportEnv { +pub struct ImportEnv { cache: ImportCache, stack: ImportStack, } diff --git a/dhall/src/semantics/resolve/hir.rs b/dhall/src/semantics/resolve/hir.rs index 3934bbb..9256425 100644 --- a/dhall/src/semantics/resolve/hir.rs +++ b/dhall/src/semantics/resolve/hir.rs @@ -10,7 +10,7 @@ pub struct AlphaVar { } #[derive(Debug, Clone, PartialEq, Eq)] -pub(crate) enum HirKind { +pub enum HirKind { /// A resolved variable (i.e. a DeBruijn index) Var(AlphaVar), /// Result of resolving an import. @@ -21,16 +21,16 @@ pub(crate) enum HirKind { // An expression with resolved variables and imports. #[derive(Debug, Clone)] -pub(crate) struct Hir { +pub struct Hir { kind: Box<HirKind>, span: Span, } impl AlphaVar { - pub(crate) fn new(idx: usize) -> Self { + pub fn new(idx: usize) -> Self { AlphaVar { idx } } - pub(crate) fn idx(self) -> usize { + pub fn idx(self) -> usize { self.idx } } diff --git a/dhall/src/semantics/resolve/mod.rs b/dhall/src/semantics/resolve/mod.rs index 517907b..33b477e 100644 --- a/dhall/src/semantics/resolve/mod.rs +++ b/dhall/src/semantics/resolve/mod.rs @@ -1,6 +1,6 @@ pub mod env; pub mod hir; pub mod resolve; -pub(crate) use env::*; -pub(crate) use hir::*; -pub(crate) use resolve::*; +pub use env::*; +pub use hir::*; +pub use resolve::*; diff --git a/dhall/src/semantics/resolve/resolve.rs b/dhall/src/semantics/resolve/resolve.rs index eb2f04f..07bd06c 100644 --- a/dhall/src/semantics/resolve/resolve.rs +++ b/dhall/src/semantics/resolve/resolve.rs @@ -16,14 +16,14 @@ use crate::syntax::{ use crate::{Parsed, Resolved}; // TODO: evaluate import headers -pub(crate) type Import = syntax::Import<()>; +pub type Import = syntax::Import<()>; /// Owned Hir with a type. Different from Tir because the Hir is owned. -pub(crate) type TypedHir = (Hir, Type); +pub type TypedHir = (Hir, Type); /// The location of some data, usually some dhall code. #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub(crate) enum ImportLocation { +pub enum ImportLocation { /// Local file Local(PathBuf), /// Remote file @@ -329,11 +329,11 @@ fn resolve_with_env( Ok(Resolved(resolved)) } -pub(crate) fn resolve(parsed: Parsed) -> Result<Resolved, Error> { +pub fn resolve(parsed: Parsed) -> Result<Resolved, Error> { resolve_with_env(&mut ImportEnv::new(), parsed) } -pub(crate) fn skip_resolve(expr: &Expr) -> Result<Hir, Error> { +pub fn skip_resolve(expr: &Expr) -> Result<Hir, Error> { traverse_resolve_expr(&mut NameEnv::new(), expr, &mut |import| { Err(ImportError::UnexpectedImport(import).into()) }) |