format
This commit is contained in:
parent
f479cf0420
commit
6012067fa5
1 changed files with 22 additions and 2 deletions
|
@ -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<ContextEntry>,
|
||||
}
|
||||
|
||||
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("Γ")?;
|
||||
|
|
Loading…
Reference in a new issue