From 489174a426e6057a68b6edd2e9b4387d09912a25 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 29 Jan 2020 21:56:52 +0000 Subject: Move envs to their own files --- dhall/src/semantics/tck/env.rs | 137 +++++++++++++++++++++++++++++++++++ dhall/src/semantics/tck/mod.rs | 2 + dhall/src/semantics/tck/tyexpr.rs | 6 +- dhall/src/semantics/tck/typecheck.rs | 58 +-------------- 4 files changed, 144 insertions(+), 59 deletions(-) create mode 100644 dhall/src/semantics/tck/env.rs (limited to 'dhall/src/semantics/tck') diff --git a/dhall/src/semantics/tck/env.rs b/dhall/src/semantics/tck/env.rs new file mode 100644 index 0000000..32c2f21 --- /dev/null +++ b/dhall/src/semantics/tck/env.rs @@ -0,0 +1,137 @@ +use crate::semantics::{AlphaVar, NzEnv, NzVar, TyExprKind, Type, Value}; +use crate::syntax::{Label, V}; + +/// Environment for indexing variables. +#[derive(Debug, Clone, Copy)] +pub(crate) struct VarEnv { + size: usize, +} + +/// Environment for resolving names. +#[derive(Debug, Clone)] +pub(crate) struct NameEnv { + names: Vec