adding types to layout
so we can test assignment
This commit is contained in:
@ -10,7 +10,7 @@ module Soml
|
||||
index = for_class.object_layout.variable_index(name)
|
||||
#raise "class field already defined:#{name} for class #{for_class.name}" if index
|
||||
#puts "Define field #{name} on class #{for_class.name}"
|
||||
index = for_class.object_layout.add_instance_variable( name ) #TODO need typing
|
||||
index = for_class.object_layout.add_instance_variable( name , type )
|
||||
|
||||
# not sure how to run class code yet. later
|
||||
raise "value #{value}" if value
|
||||
|
@ -12,14 +12,14 @@ module Soml
|
||||
process(condition)
|
||||
|
||||
branch_class = Object.const_get "Register::Is#{branch_type.capitalize}"
|
||||
true_block = Register::Label.new(statement, "if_true")
|
||||
true_block = Register::Label.new(if_true, "if_true")
|
||||
add_code branch_class.new( condition , true_block )
|
||||
|
||||
# compile the false block
|
||||
reset_regs
|
||||
process_all(if_false) if if_false
|
||||
merge = Register::Label.new(statement , "if_merge")
|
||||
add_code Register::Branch.new(statement, merge )
|
||||
add_code Register::Branch.new(if_false, merge )
|
||||
|
||||
# compile the true block
|
||||
add_code true_block
|
||||
|
Reference in New Issue
Block a user