2019-11-02 02:13:45 +01:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-05 19:44:28 +01:00
|
|
|
impl<'input> std::fmt::Debug for crate::Project<'input>
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
|
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
|
|
{
|
2019-11-05 19:44:28 +01:00
|
|
|
for block in &self.blocks
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
2019-11-05 19:44:28 +01:00
|
|
|
match block
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
2019-11-05 19:44:28 +01:00
|
|
|
crate::project::Block::Whitespace(ref text) => write!(format, "{}", text)?,
|
|
|
|
crate::project::Block::Statement(ref statement) =>
|
|
|
|
write!(format, "{}", statement.original_text)?,
|
2019-11-02 02:13:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-05 19:44:28 +01:00
|
|
|
impl<'input> std::fmt::Display for crate::Project<'input>
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
|
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
|
|
{
|
|
|
|
write!(format, "{:?}", &self)
|
|
|
|
}
|
|
|
|
}
|