diff options
author | Nadrieril | 2020-01-29 21:31:53 +0000 |
---|---|---|
committer | Nadrieril | 2020-01-29 21:31:53 +0000 |
commit | 22bec94618454f57773716870f5624579ab712ce (patch) | |
tree | 026c9c6adfc489895249ba473b5201bc32833fe4 /dhall/src/semantics/nze | |
parent | 26d4975a4c94c2b9fd0c075ad94c2588e3cf24e8 (diff) |
s/QuoteEnv/VarEnv/
Diffstat (limited to 'dhall/src/semantics/nze')
-rw-r--r-- | dhall/src/semantics/nze/nzexpr.rs | 13 |
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, } } |