removing exceptions

This commit is contained in:
Torsten Ruger
2014-07-14 16:19:47 +03:00
parent c7c4387e16
commit 93bdd8a243
8 changed files with 38 additions and 26 deletions

View File

@ -62,4 +62,8 @@ module Ast
value
end
end
class AssignmentExpression < Expression
def compile frame , method
end
end
end

View File

@ -1,7 +1,8 @@
module Ast
class IfExpression < Expression
# attr_reader :cond, :if_true, :if_false
def compile context
def compile frame , method
return nil
f = context.function
# to execute the logic as the if states it, the blocks are the other way around
# so we can the jump over the else if true ,and the else joins unconditionally after the true_block

View File

@ -1,7 +1,10 @@
module Ast
class OperatorExpression < Expression
# attr_reader :operator, :left, :right
def compile context
def compile frame , method
nil
end
def scratch
into = context.function
puts "compiling operator #{to_s}"
r_val = right.compile(context)

View File

@ -1,7 +1,10 @@
module Ast
class ReturnExpression < Expression
# attr_reader :expression
def compile context
def compile frame ,method
nil
end
def sc
into = context.function
puts "compiling return expression #{expression}, now return in return_regsiter"
expression_value = expression.compile(context)

View File

@ -1,7 +1,10 @@
module Ast
class WhileExpression < Expression
# attr_reader :condition, :body
def compile context
def compile frame , method
nil
end
def old
into = context.function
ret = into.new_block "while_end"
while_block = into.new_block "while_start"