Fixed `del ans`

dev
rm-dr 2023-10-15 11:26:08 -07:00
parent 93c34ca4a4
commit e3e23a686d
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 1 additions and 0 deletions

View File

@ -90,6 +90,7 @@ impl Context {
pub fn delete(&mut self, s: &String) -> Result<(), ()> { pub fn delete(&mut self, s: &String) -> Result<(), ()> {
if !(self.is_varible(s) || self.is_function(s)) { return Err(()) }; 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_varible(s) { self.variables.remove(s); }
if self.is_function(s) { self.functions.remove(s); } if self.is_function(s) { self.functions.remove(s); }
return Ok(()); return Ok(());