summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/resolve
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/semantics/resolve')
-rw-r--r--dhall/src/semantics/resolve/resolve.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/dhall/src/semantics/resolve/resolve.rs b/dhall/src/semantics/resolve/resolve.rs
index 07bd06c..fe3f3a9 100644
--- a/dhall/src/semantics/resolve/resolve.rs
+++ b/dhall/src/semantics/resolve/resolve.rs
@@ -227,7 +227,7 @@ fn resolve_one_import(
}
ImportMode::Location => {
let expr = location.into_location();
- let hir = skip_resolve(&expr)?;
+ let hir = skip_resolve_expr(&expr)?;
let ty = hir.typecheck_noenv()?.ty().clone();
Ok((hir, ty))
}
@@ -333,12 +333,18 @@ pub fn resolve(parsed: Parsed) -> Result<Resolved, Error> {
resolve_with_env(&mut ImportEnv::new(), parsed)
}
-pub fn skip_resolve(expr: &Expr) -> Result<Hir, Error> {
+pub fn skip_resolve_expr(expr: &Expr) -> Result<Hir, Error> {
traverse_resolve_expr(&mut NameEnv::new(), expr, &mut |import| {
Err(ImportError::UnexpectedImport(import).into())
})
}
+pub fn skip_resolve(parsed: Parsed) -> Result<Resolved, Error> {
+ let Parsed(expr, _) = parsed;
+ let resolved =skip_resolve_expr(&expr)?;
+ Ok(Resolved(resolved))
+}
+
pub trait Canonicalize {
fn canonicalize(&self) -> Self;
}