start on class compiler

idea is to get cleaner layer seperation
reduce machine and rework builtin boot
This commit is contained in:
Torsten Ruger
2018-06-30 19:20:17 +03:00
parent 4a7cc72732
commit daf1b56062
11 changed files with 51 additions and 12 deletions

View File

@ -6,6 +6,7 @@ module Vool
include Mom
def setup
Parfait.boot!
Risc.machine.boot
@ins = compile_first_method( "a = main(1 + 2)" )
end

View File

@ -6,6 +6,7 @@ module Vool
include Mom
def setup
Parfait.boot!
Risc.machine.boot
@ins = compile_first_method( "a = 5; a.div4")
end

View File

@ -0,0 +1,17 @@
require_relative "helper"
module Vool
class TestClassStatement < MiniTest::Test
include MomCompile
def setup
Parfait.boot!
@ins = compile_mom( "class Test ; def main(); return 1; end; end;")
end
def test_return
assert_equal Mom::ClassCompiler , @ins.class
end
end
end

View File

@ -43,6 +43,7 @@ module Vool
include Mom
def setup
Parfait.boot!
Risc.machine.boot
@ins = compile_first_method( "return 5.div4")
end