fixed more cases of empty block syndrome

This commit is contained in:
Torsten Ruger 2015-10-22 15:37:02 +03:00
parent 6ac339d998
commit c68577c3f4
2 changed files with 10 additions and 5 deletions

View File

@ -16,7 +16,7 @@ class Object
end end
end end
HERE HERE
@length = 17 @length = 22
check check
end end
@ -31,7 +31,7 @@ class Object
end end
end end
HERE HERE
@length = 33 @length = 38
@stdout = "10" @stdout = "10"
check check
end end
@ -53,7 +53,7 @@ class Object
end end
end end
HERE HERE
@length = 40 @length = 49
@stdout = "else" @stdout = "else"
check check
end end

View File

@ -58,7 +58,7 @@ HERE
# Phisol::Compiler.compile( statements , Virtual.machine.space.get_main ) # Phisol::Compiler.compile( statements , Virtual.machine.space.get_main )
@interpreter = Interpreter::Interpreter.new @interpreter = Interpreter::Interpreter.new
@interpreter.start Virtual.machine.init @interpreter.start Virtual.machine.init
# show_ticks # get output of what is #show_ticks # get output of what is
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer", ["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
"FunctionCall","SaveReturn","GetSlot","LoadConstant","SetSlot", "FunctionCall","SaveReturn","GetSlot","LoadConstant","SetSlot",
"LoadConstant","SetSlot","RegisterTransfer","FunctionCall","SaveReturn", "LoadConstant","SetSlot","RegisterTransfer","FunctionCall","SaveReturn",
@ -74,7 +74,12 @@ HERE
"LoadConstant","OperatorInstruction","IsZero","LoadConstant","GetSlot", "LoadConstant","OperatorInstruction","IsZero","LoadConstant","GetSlot",
"LoadConstant","OperatorInstruction","IsZero","LoadConstant","GetSlot", "LoadConstant","OperatorInstruction","IsZero","LoadConstant","GetSlot",
"LoadConstant","OperatorInstruction","IsZero","LoadConstant","GetSlot", "LoadConstant","OperatorInstruction","IsZero","LoadConstant","GetSlot",
"LoadConstant","OperatorInstruction","IsZero","LoadConstant","NilClass"].each_with_index do |name , index| "LoadConstant","OperatorInstruction","IsZero","LoadConstant","RegisterTransfer",
"GetSlot","FunctionReturn","GetSlot","GetSlot","SetSlot",
"GetSlot","GetSlot","GetSlot","OperatorInstruction","SetSlot",
"GetSlot","RegisterTransfer","GetSlot","FunctionReturn","GetSlot",
"RegisterTransfer","GetSlot","FunctionReturn","GetSlot","RegisterTransfer",
"GetSlot","FunctionReturn","RegisterTransfer","Syscall","NilClass"].each_with_index do |name , index|
got = ticks(1) got = ticks(1)
assert got.class.name.index(name) , "Wrong class for #{index+1}, expect #{name} , got #{got}" assert got.class.name.index(name) , "Wrong class for #{index+1}, expect #{name} , got #{got}"
end end