From 4dc195c8d8a2ef03621fb73d15df2c66ad68be2c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 27 Dec 2019 18:28:33 +0000 Subject: Use binder ids for Value equality --- dhall/src/semantics/core/var.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dhall/src/semantics/core/var.rs') 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() -- cgit v1.2.3