propagate constants from block_compiler up

up to method_compiler, where they are collected by mom_compiler
(and included in binary)
This commit is contained in:
Torsten Ruger
2018-08-01 16:27:34 +03:00
parent 81cc109d1e
commit 4b4528abb2
3 changed files with 19 additions and 10 deletions

View File

@ -6,7 +6,7 @@ module Mom
def setup
Parfait.boot!
@comp = compile_mom( "class Test ; def main(); return 'Hi'; end; end;")
@comp = compile_mom( "class Test ; def main(); main{return 'Ho'};return 'Hi'; end; end;")
@linker = @comp.translate(:interpreter)
end
@ -22,6 +22,9 @@ module Mom
def test_linker_constants_contains_hi
assert @linker.constants.include?("Hi")
end
def test_linker_constants_contains_ho
assert @linker.constants.include?("Ho")
end
def test_translate_platform
assert_kind_of Risc::Platform , @linker.platform
end