From 3182c121815857c0b2b3c057f1d2944c51332cdc Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 21 Jan 2020 18:51:00 +0000 Subject: Prepare Value for reverse variables I thought it would work ><. It's a bit too early --- dhall/src/semantics/nze/mod.rs | 2 +- dhall/src/semantics/nze/nzexpr.rs | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'dhall/src/semantics/nze') 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) -> Self { TyExpr { -- cgit v1.2.3