From 6012067fa5f1f8bde0aa94dcd250d7d941b44f5c Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Thu, 30 Nov 2023 00:17:28 -0600 Subject: [PATCH] format --- bidir/src/data_debruijn.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/bidir/src/data_debruijn.rs b/bidir/src/data_debruijn.rs index 0110487..bfc9ad6 100644 --- a/bidir/src/data_debruijn.rs +++ b/bidir/src/data_debruijn.rs @@ -226,7 +226,7 @@ impl Monotype { } } -#[derive(Debug, Clone)] +#[derive(Clone)] pub enum ContextEntry { TypeVar, TermAnnot(Type), @@ -235,6 +235,20 @@ pub enum ContextEntry { Marker, } +impl fmt::Debug for ContextEntry { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::TypeVar => write!(f, "Ty"), + Self::TermAnnot(arg0) => f.debug_tuple("Annot").field(arg0).finish(), + Self::ExistentialVar => write!(f, "ExVar"), + Self::ExistentialSolved(arg0) => { + f.debug_tuple("ExSolv").field(arg0).finish() + } + Self::Marker => write!(f, "▶"), + } + } +} + #[derive(Debug, Clone)] pub enum CompleteContextEntry { TypeVar(String), @@ -243,12 +257,18 @@ pub enum CompleteContextEntry { Marker(String), } -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Context { // TODO: Make this not pub(crate) pub(crate) vector: Vector, } +impl fmt::Debug for Context { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "ᴦ{:?}", self.vector) + } +} + // impl fmt::Debug for Context { // fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // f.write_str("Γ")?;