diff options
Diffstat (limited to 'dhall/src/semantics/core/var.rs')
-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() |