summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/nze
diff options
context:
space:
mode:
authorNadrieril2020-01-21 18:51:00 +0000
committerNadrieril2020-01-21 18:53:03 +0000
commit3182c121815857c0b2b3c057f1d2944c51332cdc (patch)
tree9dca465148809d990e2b2d6ae7e6b17774b7747e /dhall/src/semantics/nze
parent015b24b04128cbf5a60fbc8ac3f526306ca27378 (diff)
Prepare Value for reverse variables
I thought it would work ><. It's a bit too early
Diffstat (limited to 'dhall/src/semantics/nze')
-rw-r--r--dhall/src/semantics/nze/mod.rs2
-rw-r--r--dhall/src/semantics/nze/nzexpr.rs14
2 files changed, 14 insertions, 2 deletions
diff --git a/dhall/src/semantics/nze/mod.rs b/dhall/src/semantics/nze/mod.rs
index ef8918f..213404c 100644
--- a/dhall/src/semantics/nze/mod.rs
+++ b/dhall/src/semantics/nze/mod.rs
@@ -1,2 +1,2 @@
pub mod nzexpr;
-// pub(crate) use nzexpr::*;
+pub(crate) use nzexpr::*;
diff --git a/dhall/src/semantics/nze/nzexpr.rs b/dhall/src/semantics/nze/nzexpr.rs
index 3a5a1f9..1256ea0 100644
--- a/dhall/src/semantics/nze/nzexpr.rs
+++ b/dhall/src/semantics/nze/nzexpr.rs
@@ -82,10 +82,16 @@ pub(crate) struct QuoteEnv {
}
// Reverse-debruijn index: counts number of binders from the bottom of the stack.
-#[derive(Debug, Clone, Copy)]
+#[derive(Debug, Clone, Copy, Eq)]
pub(crate) struct NzVar {
idx: usize,
}
+// TODO: temporary hopefully
+impl std::cmp::PartialEq for NzVar {
+ fn eq(&self, _other: &Self) -> bool {
+ true
+ }
+}
impl TyEnv {
pub fn new() -> Self {
@@ -219,6 +225,12 @@ impl QuoteEnv {
}
}
+impl NzVar {
+ pub fn new(idx: usize) -> Self {
+ NzVar { idx }
+ }
+}
+
impl TyExpr {
pub fn new(kind: TyExprKind, ty: Option<Type>) -> Self {
TyExpr {