From c9c484f3532ab60383f3501bb772bec7f4ac08cc Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 31 May 2014 12:38:15 +0300 Subject: [PATCH] change program to inherit stright from code, not block (as it keeps the funcitons anyway) --- lib/vm/program.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/vm/program.rb b/lib/vm/program.rb index 7aa5fff6..dc3b8cc4 100644 --- a/lib/vm/program.rb +++ b/lib/vm/program.rb @@ -18,12 +18,12 @@ module Vm # throwing in a context for unspecified use (well one is to pass the programm/globals around) - class Program < Block + class Program < Code # Initialize with a string for cpu. Naming conventions are: for Machine XXX there exists a module XXX # with a XXXMachine in it that derives from Vm::RegisterMachine def initialize machine = nil - super("start" , nil) + super() machine = RbConfig::CONFIG["host_cpu"] unless machine machine = "intel" if machine == "x86_64" machine = machine.capitalize @@ -33,6 +33,8 @@ module Vm @objects = [] # global functions @functions = [] + + @classes = [] @entry = Core::Kernel::main_start Vm::Block.new("main_entry",nil) #main gets executed between entry and exit @main = Block.new("main",nil) @@ -66,7 +68,11 @@ module Vm end fun end - + + def get_or_create_class name + + end + # linking entry , main , exit # functions , objects def link_at( start , context)