From c36a08d52db3647e97c6cf6cb97b3c45ad34b2d2 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 21 May 2014 19:33:58 +0300 Subject: [PATCH] small fixes --- lib/ast/operator_expressions.rb | 5 +++-- lib/vm/values.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ast/operator_expressions.rb b/lib/ast/operator_expressions.rb index a3cac1b7..883b26e2 100644 --- a/lib/ast/operator_expressions.rb +++ b/lib/ast/operator_expressions.rb @@ -32,13 +32,14 @@ module Ast end l_val = left.compile(context , into) - + into = into.scope binding + case operator when ">" code = l_val.less_or_equal into , r_val when "+" res = context.function.new_local - into.add_code res.is l_val + r_val + into.res = l_val + r_val # code = res.plus into , l_val , r_val code = res when "-" diff --git a/lib/vm/values.rb b/lib/vm/values.rb index f27109c1..89db88b6 100644 --- a/lib/vm/values.rb +++ b/lib/vm/values.rb @@ -24,7 +24,7 @@ module Vm # part of the dsl, ie serves to make code like value.is a + b work # ie we save the receier as the result into the instruction and pass that back def is instruction - instruction.result = self + instruction.assign self instruction end def type