remove dead code

This commit is contained in:
Torsten Ruger 2018-03-18 10:50:37 +05:30
parent c5ec532616
commit be79388cc5
3 changed files with 3 additions and 10 deletions

View File

@ -7,10 +7,6 @@ module Mom
def to_risc(m) def to_risc(m)
Risc::Label.new(self.class.name, self.class.name + "_todo") Risc::Label.new(self.class.name, self.class.name + "_todo")
end end
# implement flatten as noop to avoid condition
def flatten( options = {} )
return self
end
end end
# A label with a name # A label with a name

View File

@ -21,8 +21,9 @@ end
module MomCompile module MomCompile
include CompilerHelper include CompilerHelper
def compile_first_method input def compile_first_method( input )
# works a lot like Vool.ruby_to_vool # works a lot like Vool.ruby_to_vool
# but here we return the intermediate mom instructions that are otherwise not available
statements = Vool::RubyCompiler.compile as_test_main( input ) statements = Vool::RubyCompiler.compile as_test_main( input )
statements = statements.normalize statements = statements.normalize
res = statements.create_objects res = statements.create_objects
@ -33,10 +34,6 @@ module MomCompile
res res
end end
def compile_first_method_flat(input)
compile_first_method(input).flatten
end
def check_array( should , is ) def check_array( should , is )
index = 0 index = 0
test = is test = is

View File

@ -7,7 +7,7 @@ module Vool
def setup def setup
Risc.machine.boot Risc.machine.boot
@ins = compile_first_method_flat( "a = 5; a.mod4") @ins = compile_first_method( "a = 5; a.mod4")
end end
def test_check_type def test_check_type
assert_equal NotSameCheck , @ins.next.class , @ins assert_equal NotSameCheck , @ins.next.class , @ins