From d4d8f41b00d04c870d1b6d802b52e7b144251ca8 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 2 Aug 2023 12:50:44 -0700 Subject: [PATCH] Comments --- src/evaluate/evaluate.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/evaluate/evaluate.rs b/src/evaluate/evaluate.rs index c70a086..9544ed2 100644 --- a/src/evaluate/evaluate.rs +++ b/src/evaluate/evaluate.rs @@ -46,7 +46,10 @@ pub fn evaluate(t: &Expression, context: &mut Context) -> Result { Some(evaluate(&c.value(), context).unwrap()) }, Expression::Variable(l, s) => { - move_up = false; // Don't move up, re-evaluate + // Don't move up, re-evaluate + // This makes variables containing floating variables work properly + // (For example, try x = a + 2, a = 2, x. x should evaluate to 4.) + move_up = false; let v = context.get_variable(&s); // Error if variable is undefined.