47 lines
1.1 KiB
Rust
47 lines
1.1 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<'input> std::fmt::Debug for crate::Project<'input>
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
for block in &self.blocks
|
|
{
|
|
match block
|
|
{
|
|
crate::project::Block::Whitespace(ref text) => write!(format, "{}", text)?,
|
|
crate::project::Block::Statement(ref statement) =>
|
|
write!(format, "{}", statement.original_text)?,
|
|
}
|
|
}
|
|
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
impl<'input> std::fmt::Display for crate::Project<'input>
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
write!(format, "{:?}", &self)
|
|
}
|
|
}
|