From 11316a9cfca19fefb6f58f515a7a0bfee848b759 Mon Sep 17 00:00:00 2001 From: Olivier Date: Wed, 1 May 2024 22:28:30 +0100 Subject: [PATCH] Implement equality for strings --- hornbeam_interpreter/src/engine.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hornbeam_interpreter/src/engine.rs b/hornbeam_interpreter/src/engine.rs index 18aaa97..ffe8b15 100644 --- a/hornbeam_interpreter/src/engine.rs +++ b/hornbeam_interpreter/src/engine.rs @@ -597,7 +597,9 @@ impl<'a, O: OutputSystem + Send, LS: LocalisationSystem + Sync + Send> Interpret location: loc.clone(), }) } - }, + } + (Value::Str(lstr), Value::Str(rstr)) => Ok(Value::Bool(lstr == rstr)), + // TODO List vs List. Not *that* useful but can be occasionally. But it does involve recursion. (lother, rother) => Err(InterpreterError::TypeError { context: "Equals".to_string(), conflict: format!("can't test {lother:?} and {rother:?} for equality!"),