summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/nze/nzexpr.rs
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/nzexpr.rs
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/nzexpr.rs')
-rw-r--r--dhall/src/semantics/nze/nzexpr.rs14
1 files changed, 13 insertions, 1 deletions
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 {