From c629fac4297b8f13bdab00100f3b05549174154e Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Tue, 5 Aug 2025 11:40:00 +0300 Subject: Added boilerplate and tests for booleans, integer comparisons and boolean operators. --- src/type/display.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/type/display.rs') 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!(), } } } -- cgit v1.2.3