mirror of https://github.com/rm-dr/daisy
Comments
parent
2d69e73897
commit
d4d8f41b00
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue