aboutsummaryrefslogtreecommitdiff
path: root/src/type/display.rs
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-05 11:40:00 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-05 11:40:00 +0300
commitc629fac4297b8f13bdab00100f3b05549174154e (patch)
treecadc8f0c9b16021338134a9c7a90478bcd8f2bdc /src/type/display.rs
parent0d9c5b7fd7dec374ec357581f721f5cdc828b7ae (diff)
downloadmyslip-c629fac4297b8f13bdab00100f3b05549174154e.tar.gz
myslip-c629fac4297b8f13bdab00100f3b05549174154e.zip
Added boilerplate and tests for booleans, integer comparisons and boolean operators.
Diffstat (limited to 'src/type/display.rs')
-rw-r--r--src/type/display.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/type/display.rs b/src/type/display.rs
index 2fca5f9..832b289 100644
--- a/src/type/display.rs
+++ b/src/type/display.rs
@@ -11,8 +11,9 @@ impl fmt::Display for Type {
/// ```rust
/// use myslip::r#type::{Type::*, util::*};
/// assert_eq!(Integer.to_string(), "Int".to_string());
- /// assert_eq!(arr(Integer, Integer).to_string(), "(Int -> Int)".to_string());
- /// assert_eq!(List(vec![Integer, Integer, Integer]).to_string(), "(Int Int Int)".to_string());
+ /// assert_eq!(Boolean.to_string(), "Bool".to_string());
+ /// assert_eq!(arr(Integer, Boolean).to_string(), "(Int -> Bool)".to_string());
+ /// assert_eq!(List(vec![Integer, Boolean, Integer]).to_string(), "(Int Bool Int)".to_string());
/// ```
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
@@ -27,6 +28,7 @@ impl fmt::Display for Type {
.join(" ")
),
VarType(name) => write!(f, "{}", name),
+ Boolean => todo!(),
}
}
}