diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-05 11:40:00 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-05 11:40:00 +0300 |
commit | c629fac4297b8f13bdab00100f3b05549174154e (patch) | |
tree | cadc8f0c9b16021338134a9c7a90478bcd8f2bdc /src/type/display.rs | |
parent | 0d9c5b7fd7dec374ec357581f721f5cdc828b7ae (diff) | |
download | myslip-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.rs | 6 |
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!(), } } } |