func (b *binary) Eval(context value.Context) value.Value { rhs := b.right.Eval(context) if b.op == "=" { // Special handling as we cannot evaluate the left. // We know the left is a variableExpr. lhs := b.left.(variableExpr) context.Assign(lhs.name, rhs) return Assignment{Value: rhs} } lhs := b.left.Eval(context) return context.EvalBinary(lhs, b.op, rhs) }
func (b *binary) Eval(context value.Context) value.Value { return context.EvalBinary(b.left.Eval(context), b.op, b.right.Eval(context)) }