75 lines
1.8 KiB
Rust
75 lines
1.8 KiB
Rust
|
impl std::fmt::Debug for crate::project::StatementKind
|
||
|
{
|
||
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||
|
{
|
||
|
match &self
|
||
|
{
|
||
|
crate::project::StatementKind::Axiom => write!(format, "axiom"),
|
||
|
crate::project::StatementKind::Lemma => write!(format, "lemma"),
|
||
|
crate::project::StatementKind::Conjecture => write!(format, "conjecture"),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl std::fmt::Display for crate::project::StatementKind
|
||
|
{
|
||
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||
|
{
|
||
|
write!(format, "{:?}", &self)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl std::fmt::Debug for crate::Project
|
||
|
{
|
||
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||
|
{
|
||
|
let mut line_separator = "";
|
||
|
let mut section_separator = "";
|
||
|
|
||
|
if let Some(axioms) = self.statements.get(&crate::project::StatementKind::Axiom)
|
||
|
{
|
||
|
for axiom in axioms
|
||
|
{
|
||
|
write!(format, "{}{:?}: {:?}.", line_separator, crate::project::StatementKind::Axiom, axiom)?;
|
||
|
line_separator = "\n";
|
||
|
}
|
||
|
|
||
|
section_separator = "\n";
|
||
|
}
|
||
|
|
||
|
if let Some(lemmas) = self.statements.get(&crate::project::StatementKind::Lemma)
|
||
|
{
|
||
|
write!(format, "{}", section_separator)?;
|
||
|
|
||
|
for lemma in lemmas
|
||
|
{
|
||
|
write!(format, "{}{:?}: {:?}.", line_separator, crate::project::StatementKind::Lemma, lemma)?;
|
||
|
line_separator = "\n";
|
||
|
}
|
||
|
|
||
|
section_separator = "\n";
|
||
|
}
|
||
|
|
||
|
if let Some(conjectures) = self.statements.get(&crate::project::StatementKind::Conjecture)
|
||
|
{
|
||
|
write!(format, "{}", section_separator)?;
|
||
|
|
||
|
for conjecture in conjectures
|
||
|
{
|
||
|
write!(format, "{}{:?}: {:?}.", line_separator, crate::project::StatementKind::Conjecture, conjecture)?;
|
||
|
line_separator = "\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Ok(())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl std::fmt::Display for crate::Project
|
||
|
{
|
||
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||
|
{
|
||
|
write!(format, "{:?}", &self)
|
||
|
}
|
||
|
}
|