From 823bb3130591716771190e3123c5772250e00dc7 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 29 Sep 2023 13:03:55 -0400 Subject: [PATCH] Remove semicolons from language --- src/interface.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/interface.rs b/src/interface.rs index 1c7d09e..72b56f6 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -33,7 +33,7 @@ pub fn eval(source: &str) -> Vec> { /// context.set_value("two".into(), 2.into()).unwrap(); // Do proper error handling here /// context.set_value("three".into(), 3.into()).unwrap(); // Do proper error handling here /// -/// let dust_code = "four = 4; one + two + three + four"; +/// let dust_code = "four = 4 one + two + three + four"; /// /// assert_eq!( /// eval_with_context(dust_code, &mut context), @@ -46,13 +46,8 @@ pub fn eval_with_context(source: &str, context: &mut VariableMap) -> Vec Ok(Statement::Closed(Expression::new(child, source)?)), "open_statement" => Ok(Self::Open(Expression::new(child, source)?)), _ => Err(Error::UnexpectedSourceNode { - expected: "closed_statement or open_statement", + expected: "open_statement", actual: node.kind(), }), } @@ -181,11 +174,6 @@ impl Statement { source: &str, ) -> Result { match self { - Statement::Closed(expression) => { - expression.run(context, &mut cursor, source)?; - - Ok(Value::Empty) - } Statement::Open(expression) => expression.run(context, &mut cursor, source), } }