compile from mom compiler to risc

This commit is contained in:
2019-08-10 12:42:47 +03:00
parent 5994cd3276
commit d5f89a4979
8 changed files with 51 additions and 45 deletions

View File

@ -3,8 +3,8 @@ module Risc
class FakeCallable
end
class FakeCallableCompiler < CallableCompiler
def initialize(a,b,c)
super(a,b,c)
def initialize(a,c)
super(a,c)
end
def source_name
"luke"
@ -14,8 +14,8 @@ module Risc
def setup
Parfait.boot!({})
label = Risc.label("hi","ho")
@compiler = FakeCallableCompiler.new(FakeCallable.new , [] , label)
label = Mom::Label.new("hi","ho")
@compiler = FakeCallableCompiler.new(FakeCallable.new , label)
end
def test_ok
assert @compiler

View File

@ -67,14 +67,6 @@ module Risc
assert_equal Mom::MethodCompiler , compiler.class
compiler
end
def test_has_method_constant
compiler = constant_setup("def meth; return 'Hi';end")
assert compiler.constants.include?("Hi")
end
def test_has_block_constant
compiler = constant_setup("def meth; meth{return 'Ho'};return 'Hi';end")
assert compiler.constants.include?("Ho")
end
def test_return_label
compiler = constant_setup("def meth; return 'Hi';end")
assert_equal "return_label", compiler.return_label.name