still some names that needed changing

This commit is contained in:
Torsten Ruger 2018-08-12 14:48:20 +03:00
parent 25d7b8bd83
commit fee9e261a5
4 changed files with 9 additions and 8 deletions

View File

@ -59,7 +59,7 @@ module Parfait
bin = binary bin = binary
while(bin) do while(bin) do
block.call( bin ) block.call( bin )
bin = bin.next_callable bin = bin.next_code
end end
end end

View File

@ -12,18 +12,19 @@ module Parfait
# #
class VoolMethod < Object class VoolMethod < Object
attr :type, :name , :args_type , :frame_type , :source attr :type, :name , :args_type , :frame_type
attr_reader :source
def initialize(name , args_type , frame_type , source ) def initialize(name , args_type , frame_type , source )
self.name = name self.name = name
self.args_type = args_type self.args_type = args_type
self.frame_type = frame_type self.frame_type = frame_type
self.source = source @source = source
raise "Name must be symbol" unless name.is_a?(Symbol) raise "Name must be symbol" unless name.is_a?(Symbol)
raise "args_type must be type" unless args_type.is_a?(Parfait::Type) raise "args_type must be type" unless args_type.is_a?(Parfait::Type)
raise "frame_type must be type" unless frame_type.is_a?(Parfait::Type) raise "frame_type must be type" unless frame_type.is_a?(Parfait::Type)
raise "source must be vool" unless source.is_a?(Vool::Statement) raise "source must be vool" unless source.is_a?(Vool::Statement)
raise "Empty bod" if(source.is_a?(Vool::Statements) and source.empty?) raise "Empty bod" if(@source.is_a?(Vool::Statements) and @source.empty?)
end end
def create_callable_method( type ) def create_callable_method( type )
@ -34,7 +35,7 @@ module Parfait
def compiler_for(self_type) def compiler_for(self_type)
callable_method = create_callable_method(self_type) callable_method = create_callable_method(self_type)
compiler = Risc::MethodCompiler.new( callable_method ) compiler = Risc::MethodCompiler.new( callable_method )
head = source.to_mom( compiler ) head = @source.to_mom( compiler )
compiler.add_mom(head) compiler.add_mom(head)
compiler compiler
end end

View File

@ -168,7 +168,7 @@ module Risc
def write_BinaryCode( code ) def write_BinaryCode( code )
write_ref_for( code.get_type ) write_ref_for( code.get_type )
write_ref_for( code.next ) write_ref_for( code.next_code )
code.each_word do |word| code.each_word do |word|
@stream.write_unsigned_int_32( word || 0 ) @stream.write_unsigned_int_32( word || 0 )
end end

View File

@ -18,7 +18,7 @@ module Risc
assert_equal 72 , Position.get(@instruction.last).at assert_equal 72 , Position.get(@instruction.last).at
end end
def test_next def test_next
assert @binary.next assert @binary.next_code
end end
def test_insert_initializes def test_insert_initializes
@instruction.insert DummyInstruction.new @instruction.insert DummyInstruction.new