Builtin is no more, final conversions done

All preloading where it needs to be
(some)tests for the preload
split compiler test
remembered binary tests (usually just run on travis)
This commit is contained in:
2019-09-13 20:34:41 +03:00
parent 8af17a69ea
commit 1ee01622c3
15 changed files with 74 additions and 34 deletions

View File

@ -16,7 +16,7 @@ module Mom
# lazily instantiate the compiler for init function
def init_compiler
@init_compilers ||= create_init_compiler
@init_compilers ||= MomCollection.create_init_compiler
end
# Return all compilers, namely the MethodCompilers passed in, plus the
@ -47,8 +47,8 @@ module Mom
# - load fist message, set up Space as receiver
# - call main, ie set up message for that etc
# - exit (exit_sequence) which passes a machine int out to c
def create_init_compiler
compiler = self.class.compiler_for(:Object,:__init__ ,{})
def self.create_init_compiler
compiler = compiler_for(:Object,:__init__ ,{})
compiler._reset_for_init # no return, just for init
compiler.add_code Init.new("missing")
return compiler

View File

@ -24,8 +24,10 @@ class RubyXC < Thor
rescue
fail MalformattedArgumentError , "No such file #{file}"
end
code = get_preload + ruby
compiler = RubyX::RubyXCompiler.new(extract_options)
linker = compiler.ruby_to_binary(ruby, :interpreter)
linker = compiler.ruby_to_binary(code, :interpreter)
puts "interpreting #{file}"

View File

@ -105,5 +105,8 @@ module Vool
def ct_type
Parfait.object_space.get_type_by_class_name(:Word)
end
def to_s(depth = 0)
":#{@value}"
end
end
end

View File

@ -14,7 +14,6 @@ module Vool
{
"Object.get" => "def get_internal_word(at); X.get_internal_word;end",
"Object.missing" => "def method_missing(at); X.method_missing;end",
"Object.init" => "def __init__(at); X.init;end",
"Object.exit" => "def exit; X.exit;end",
"Integer.div4" => "def div4; X.div4;end",
"Integer.div10" => "def div10; X.div10;end",
@ -32,7 +31,7 @@ module Vool
"Word.put" => "def putstring(at); X.putstring;end",
"Word.set" => "def set_internal_byte(at, val); X.set_internal_byte;end",
"Word.get" => "def get_internal_byte(at); X.get_internal_byte;end",
"Space.main" => "def main(args);return;end",
"Space.main" => "def main(args);return nil;end",
}
end
def self.builtin_code