From e3e23a686d4bc45b368ce2ab318ab4d8712b2466 Mon Sep 17 00:00:00 2001 From: rm-dr <96270320+rm-dr@users.noreply.github.com> Date: Sun, 15 Oct 2023 11:26:08 -0700 Subject: [PATCH] Fixed `del ans` --- src/context.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/context.rs b/src/context.rs index 3839f2f..6bdbfc6 100644 --- a/src/context.rs +++ b/src/context.rs @@ -90,6 +90,7 @@ impl Context { pub fn delete(&mut self, s: &String) -> Result<(), ()> { if !(self.is_varible(s) || self.is_function(s)) { return Err(()) }; + if s == "ans" { return Err(()) }; if self.is_varible(s) { self.variables.remove(s); } if self.is_function(s) { self.functions.remove(s); } return Ok(());