From ca041033728ef0811e457504d13cf66648662b26 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 18 Feb 2024 00:40:48 -0500 Subject: [PATCH] Clean up --- src/interpret.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/interpret.rs b/src/interpret.rs index 5c8b93c..910de4c 100644 --- a/src/interpret.rs +++ b/src/interpret.rs @@ -129,13 +129,13 @@ impl Interpreter { /// This function [parses][Self::parse], [validates][Self::validate] and /// [runs][Root::run] using the same source code. pub fn run(&mut self, source: &str) -> Result { - self.validate(source)? - .run(source, &self.context) - .map_err(|error| Error::Runtime(error)) + let final_value = self.validate(source)?.run(source, &self.context)?; + + Ok(final_value) } - /// Return an s-expression displaying a syntax tree of the source, or the - /// ParserCancelled error if the parser takes too long. + /// Return an s-expression displaying a syntax tree of the source or an + /// error. pub fn syntax_tree(&mut self, source: &str) -> Result { Ok(self.parse(source)?.root_node().to_sexp()) }