diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-14 15:31:27 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-14 15:31:27 +0300 |
commit | 928a3358483f60db84dc2918415882b35adc006b (patch) | |
tree | 0b35b8e601f3ca93cdeb7f8d45bb1d06cf274e66 /src/type/display.rs | |
parent | 907bd54d19f6bf14a130a136df6f37cc5d256468 (diff) | |
download | myslip-928a3358483f60db84dc2918415882b35adc006b.tar.gz myslip-928a3358483f60db84dc2918415882b35adc006b.zip |
fix: removed obsolete code for handling types as they are now parsed directly to atoms
Diffstat (limited to 'src/type/display.rs')
-rw-r--r-- | src/type/display.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/type/display.rs b/src/type/display.rs index 56b22b6..27f1427 100644 --- a/src/type/display.rs +++ b/src/type/display.rs @@ -19,21 +19,21 @@ impl fmt::Display for Type { /// Examples: /// ```rust /// use myslip::r#type::{Type::*, util::*}; - /// assert_eq!(Integer.to_string(), "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()); + /// assert_eq!(Integer.to_string(), "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 { - Integer => write!(f, "{}", "int"), - Boolean => write!(f, "{}", "bool"), + Integer => write!(f, "{}", "Int"), + Boolean => write!(f, "{}", "Bool"), QuoteTy => write!(f, "{}", "Quote"), VecType => write!(f, "{}", "Vector"), LetType => write!(f, "{}", "Let"), - NilType => write!(f, "()"), + NilType => write!(f, "Nil"), TypeLit => write!(f, "[type literal]"), - VecOf(ty) => write!(f, "({} ... {})", *ty, *ty), + VecOf(ty) => write!(f, "({} ...)", *ty), Arrow(a, b) => write!(f, "({} -> {})", a, b), List(types) => write!( f, @@ -67,7 +67,7 @@ impl fmt::Display for TypeError { /// expected: arr(VarType("?".to_string()), VarType("?".to_string())), /// found: Integer /// }.to_string(), - /// "invalid operator: '1'\nexpected: '(? -> ?)'\nfound: 'int'".to_string() + /// "invalid operator: '1'\nexpected: '(? -> ?)'\nfound: 'Int'".to_string() /// ); /// assert_eq!( /// InvalidArgList { @@ -75,7 +75,7 @@ impl fmt::Display for TypeError { /// expected: List(vec![Integer, Integer]), /// found: List(vec![Integer, Integer, Integer]), /// }.to_string(), - /// "invalid argument list: '(1 2 3)'\nexpected: '(int int)'\nfound: '(int int int)'".to_string() + /// "invalid argument list: '(1 2 3)'\nexpected: '(Int Int)'\nfound: '(Int Int Int)'".to_string() /// ); /// assert_eq!( /// UnboundGeneric(String::from("?")).to_string(), @@ -86,7 +86,7 @@ impl fmt::Display for TypeError { /// argtype: Integer, /// generictype: arr(VarType("T".to_string()), Integer) /// }.to_string(), - /// "incompatible argument type 'int' and generic operator type '(T -> int)'".to_string() + /// "incompatible argument type 'Int' and generic operator type '(T -> Int)'".to_string() /// ); /// ``` fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |