small fixes

This commit is contained in:
Torsten Ruger 2014-05-21 19:33:58 +03:00
parent b281c24a39
commit c36a08d52d
2 changed files with 4 additions and 3 deletions

View File

@ -32,13 +32,14 @@ module Ast
end end
l_val = left.compile(context , into) l_val = left.compile(context , into)
into = into.scope binding
case operator case operator
when ">" when ">"
code = l_val.less_or_equal into , r_val code = l_val.less_or_equal into , r_val
when "+" when "+"
res = context.function.new_local 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.plus into , l_val , r_val
code = res code = res
when "-" when "-"

View File

@ -24,7 +24,7 @@ module Vm
# part of the dsl, ie serves to make code like value.is a + b work # 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 # ie we save the receier as the result into the instruction and pass that back
def is instruction def is instruction
instruction.result = self instruction.assign self
instruction instruction
end end
def type def type