Compare commits
3 Commits
parser-old
...
master
Author | SHA1 | Date | |
---|---|---|---|
ae3925c72b | |||
6183ae22b5 | |||
a7e07380ff |
@ -67,6 +67,26 @@ impl Precedence for crate::Formula
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for crate::SpecialInteger
|
||||
{
|
||||
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||
{
|
||||
match &self
|
||||
{
|
||||
crate::SpecialInteger::Infimum => write!(format, "#inf"),
|
||||
crate::SpecialInteger::Supremum => write!(format, "#sup"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for crate::SpecialInteger
|
||||
{
|
||||
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||
{
|
||||
write!(format, "{:?}", &self)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for crate::FunctionDeclaration
|
||||
{
|
||||
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||
@ -151,8 +171,7 @@ impl<'term> std::fmt::Debug for TermDisplay<'term>
|
||||
{
|
||||
crate::Term::Boolean(true) => write!(format, "true"),
|
||||
crate::Term::Boolean(false) => write!(format, "false"),
|
||||
crate::Term::SpecialInteger(crate::SpecialInteger::Infimum) => write!(format, "#inf"),
|
||||
crate::Term::SpecialInteger(crate::SpecialInteger::Supremum) => write!(format, "#sup"),
|
||||
crate::Term::SpecialInteger(value) => write!(format, "{:?}", value),
|
||||
crate::Term::Integer(value) => write!(format, "{}", value),
|
||||
crate::Term::String(value) => write!(format, "\"{}\"", value),
|
||||
crate::Term::Variable(variable) => write!(format, "{:?}", variable.declaration),
|
||||
@ -164,9 +183,9 @@ impl<'term> std::fmt::Debug for TermDisplay<'term>
|
||||
"number of function arguments differs from declaration (expected {}, got {})",
|
||||
function.declaration.arity, function.arguments.len());
|
||||
|
||||
if function.arguments.len() > 0
|
||||
if !function.arguments.is_empty()
|
||||
{
|
||||
write!(format, "{}(", function.declaration.name)?;
|
||||
write!(format, "(")?;
|
||||
|
||||
let mut separator = "";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user