diff options
author | Nadrieril | 2019-12-27 18:28:33 +0000 |
---|---|---|
committer | Nadrieril | 2020-01-17 10:06:00 +0000 |
commit | 4dc195c8d8a2ef03621fb73d15df2c66ad68be2c (patch) | |
tree | ab6e305e09eb5e104cfa31811da68440dd88a578 /dhall/src/semantics/core/var.rs | |
parent | 8cbec8c75d9e52091bdfe28b60b6ee698d9c1392 (diff) |
Use binder ids for Value equality
Diffstat (limited to '')
-rw-r--r-- | dhall/src/semantics/core/var.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dhall/src/semantics/core/var.rs b/dhall/src/semantics/core/var.rs index 98b315e..4245e40 100644 --- a/dhall/src/semantics/core/var.rs +++ b/dhall/src/semantics/core/var.rs @@ -72,12 +72,18 @@ impl AlphaVar { self.normal.clone() } } + pub(crate) fn binder(&self) -> Binder { + Binder::new(self.normal.0.clone(), self.binder_uid) + } } impl Binder { pub(crate) fn new(name: Label, uid: BinderUID) -> Self { Binder { name, uid } } + pub(crate) fn same_binder(&self, other: &Binder) -> bool { + self.uid == other.uid + } pub(crate) fn to_label_maybe_alpha(&self, alpha: bool) -> Label { if alpha { "_".into() |