pull/2/head
Mark 2023-08-02 12:50:44 -07:00
parent 2d69e73897
commit d4d8f41b00
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,10 @@ pub fn evaluate(t: &Expression, context: &mut Context) -> Result<Expression, (Li
Expression::Constant(_, c) => { Some(evaluate(&c.value(), context).unwrap()) }, Expression::Constant(_, c) => { Some(evaluate(&c.value(), context).unwrap()) },
Expression::Variable(l, s) => { 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); let v = context.get_variable(&s);
// Error if variable is undefined. // Error if variable is undefined.