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/hir.rs10
-rw-r--r--dhall/src/semantics/resolve/resolve.rs9
2 files changed, 8 insertions, 11 deletions
diff --git a/dhall/src/semantics/resolve/hir.rs b/dhall/src/semantics/resolve/hir.rs
index d0bec5a..73fc371 100644
--- a/dhall/src/semantics/resolve/hir.rs
+++ b/dhall/src/semantics/resolve/hir.rs
@@ -9,7 +9,7 @@ pub struct AlphaVar {
idx: usize,
}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum HirKind {
/// A resolved variable (i.e. a DeBruijn index)
Var(AlphaVar),
@@ -128,11 +128,3 @@ impl std::cmp::PartialEq for Hir {
}
}
impl std::cmp::Eq for Hir {}
-impl std::hash::Hash for Hir {
- fn hash<H>(&self, state: &mut H)
- where
- H: std::hash::Hasher,
- {
- self.kind.hash(state)
- }
-}
diff --git a/dhall/src/semantics/resolve/resolve.rs b/dhall/src/semantics/resolve/resolve.rs
index 22fb1a0..23d4c3d 100644
--- a/dhall/src/semantics/resolve/resolve.rs
+++ b/dhall/src/semantics/resolve/resolve.rs
@@ -8,7 +8,8 @@ use crate::syntax;
use crate::syntax::{BinOp, Expr, ExprKind, FilePath, ImportLocation, URL};
use crate::{Parsed, ParsedExpr, Resolved};
-pub(crate) type Import = syntax::Import<Hir>;
+// TODO: evaluate import headers
+pub(crate) type Import = syntax::Import<()>;
/// A root from which to resolve relative imports.
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -120,7 +121,11 @@ fn traverse_resolve_expr(
Ok::<_, Error>(hir)
})?;
let kind = match kind {
- ExprKind::Import(import) => f(import)?.kind().clone(),
+ ExprKind::Import(import) => {
+ // TODO: evaluate import headers
+ let import = import.traverse_ref(|_| Ok::<_, Error>(()))?;
+ f(import)?.kind().clone()
+ }
kind => HirKind::Expr(kind),
};
Hir::new(kind, expr.span())