Change Mom to SlotMachine

rather large commit, but essentially a simple rename
Rationale in docs and blogs
This commit is contained in:
2019-10-03 20:55:41 +03:00
parent fd8a3e9cc5
commit c43436f35a
170 changed files with 481 additions and 480 deletions

View File

@ -6,7 +6,7 @@ module Risc
def setup
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
label = Mom::Label.new( "source_name", "return_label")
label = SlotMachine::Label.new( "source_name", "return_label")
@builder = Risc::MethodCompiler.new( FakeCallable.new ,label).builder("source")
@label = Risc.label("source","name")
@start = @builder.compiler.current

View File

@ -5,8 +5,8 @@ module Risc
include Parfait::MethodHelper
def setup
Parfait.boot!(Parfait.default_test_options)
@method = Mom::MomCollection.compiler_for( :Space , :main,{},{}).callable
@compiler = Risc::MethodCompiler.new( @method , Mom::Label.new( "source_name", "return_label"))
@method = SlotMachine::SlotCollection.compiler_for( :Space , :main,{},{}).callable
@compiler = Risc::MethodCompiler.new( @method , SlotMachine::Label.new( "source_name", "return_label"))
@builder = @compiler.builder(@method)
end
def test_inserts_built

View File

@ -7,7 +7,7 @@ module Risc
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
method = FakeCallable.new
@compiler = Risc::MethodCompiler.new( method, Mom::Label.new( "source_name", "return_label") )
@compiler = Risc::MethodCompiler.new( method, SlotMachine::Label.new( "source_name", "return_label") )
@builder = @compiler.builder(method)
end
def test_list

View File

@ -12,7 +12,7 @@ module Risc
def setup
Parfait.boot!({})
label = Mom::Label.new("hi","ho")
label = SlotMachine::Label.new("hi","ho")
@compiler = FakeCallableCompiler.new(FakeCallable.new , label)
end
def test_ok
@ -25,7 +25,7 @@ module Risc
assert_equal Label , @compiler.current.class
assert_equal "ho" , @compiler.current.name
end
def test_mom
def test_slot
assert @compiler.risc_instructions
end
def test_const

View File

@ -7,7 +7,7 @@ module Risc
def setup
code = in_Test("def meth; @ivar = 5;return ;end")
rubyx = RubyX::RubyXCompiler.new(RubyX.default_test_options)
@compiler = rubyx.ruby_to_mom(code).compilers.to_risc
@compiler = rubyx.ruby_to_slot(code).compilers.to_risc
end
def test_compiles_risc
assert_equal Risc::MethodCompiler , @compiler.class

View File

@ -1,11 +1,11 @@
require_relative "helper"
module Risc
class TestMomCompilerTranslate < MiniTest::Test
include MomCompile
class TestSlotMachineCompilerTranslate < MiniTest::Test
include SlotMachineCompile
def setup
@comp = compile_mom( "class Space ; def main(); main{return 'Ho'};return 'Hi'; end; end;")
@comp = compile_slot( "class Space ; def main(); main{return 'Ho'};return 'Hi'; end; end;")
@linker = @comp.to_risc.translate(:interpreter)
end

View File

@ -1,11 +1,11 @@
require_relative "helper"
module Risc
class TestMomCompilerTranslate < MiniTest::Test
include MomCompile
class TestSlotMachineCompilerTranslate < MiniTest::Test
include SlotMachineCompile
def setup
@comp = compile_mom( "class Space ; def main(); main{return 'Ho'};return 'Hi'; end; end;")
@comp = compile_slot( "class Space ; def main(); main{return 'Ho'};return 'Hi'; end; end;")
@linker = @comp.to_risc.translate(:interpreter)
end