diff options
Diffstat (limited to 'src/type/check.rs')
-rw-r--r-- | src/type/check.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/type/check.rs b/src/type/check.rs index b2815c7..9d7c52b 100644 --- a/src/type/check.rs +++ b/src/type/check.rs @@ -143,6 +143,24 @@ impl SExp { /// }; /// Atom(Fun).type_check(); /// ``` + /// + /// **Pattern matching** + /// + /// If this works, I guess it seems to work... + /// ```rust + /// use myslip::{ + /// r#type::{*, Type::*, TypeError::*, util::*}, + /// sexp::{SExp::*, SLeaf::*, util::*}, + /// parse::parsetree::parse_to_ast + /// }; + /// + /// assert_eq!( + /// parse_to_ast( + /// "(case (1 2 3 true false) ((x 2 3 false true) (+ x 1)) ((0 0 0 true true) 0) (_ 1))" + /// ).unwrap().type_check(), + /// Ok(Integer) + /// ); + /// ``` /// /// /// Though perhaps the most important task of the type system |