summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/nze
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/semantics/nze')
-rw-r--r--dhall/src/semantics/nze/nzexpr.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/dhall/src/semantics/nze/nzexpr.rs b/dhall/src/semantics/nze/nzexpr.rs
index 7263cac..87d0269 100644
--- a/dhall/src/semantics/nze/nzexpr.rs
+++ b/dhall/src/semantics/nze/nzexpr.rs
@@ -9,7 +9,7 @@ pub(crate) struct NameEnv {
}
#[derive(Debug, Clone, Copy)]
-pub(crate) struct QuoteEnv {
+pub(crate) struct VarEnv {
size: usize,
}
@@ -30,8 +30,8 @@ impl NameEnv {
names: names.collect(),
}
}
- pub fn as_quoteenv(&self) -> QuoteEnv {
- QuoteEnv {
+ pub fn as_varenv(&self) -> VarEnv {
+ VarEnv {
size: self.names.len(),
}
}
@@ -72,16 +72,15 @@ impl NameEnv {
}
}
-// TODO: rename to VarEnv
-impl QuoteEnv {
+impl VarEnv {
pub fn new() -> Self {
- QuoteEnv { size: 0 }
+ VarEnv { size: 0 }
}
pub fn size(&self) -> usize {
self.size
}
pub fn insert(&self) -> Self {
- QuoteEnv {
+ VarEnv {
size: self.size + 1,
}
}