From d723f7cece42d9eb9eae9dfedaf0dbaecf329f37 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 9 Jul 2024 06:14:44 -0500 Subject: [PATCH] cl-interpret: String-building addition Note: This drastically increases the number of symbols. Yeowch. --- compiler/cl-interpret/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/cl-interpret/src/lib.rs b/compiler/cl-interpret/src/lib.rs index 508b188..aca2a78 100644 --- a/compiler/cl-interpret/src/lib.rs +++ b/compiler/cl-interpret/src/lib.rs @@ -209,6 +209,10 @@ pub mod convalue { (ConValue::Empty, ConValue::Empty) => ConValue::Empty, (ConValue::Int(a), ConValue::Int(b)) => ConValue::Int(a.wrapping_add(b)), (ConValue::String(a), ConValue::String(b)) => (a.to_string() + &b.to_string()).into(), + (ConValue::String(s), ConValue::Char(c)) => { let mut s = s.to_string(); s.push(c); s.into() } + (ConValue::Char(a), ConValue::Char(b)) => { + ConValue::String([a, b].into_iter().collect::().into()) + } _ => Err(Error::TypeError)? ] BitAnd: bitand = [