From fee9e261a57693f7c3ec304af9db6a54bf089eac Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sun, 12 Aug 2018 14:48:20 +0300 Subject: [PATCH] still some names that needed changing --- lib/parfait/callable.rb | 2 +- lib/parfait/vool_method.rb | 11 ++++++----- lib/risc/text_writer.rb | 2 +- test/risc/position/test_instruction_listener1.rb | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/parfait/callable.rb b/lib/parfait/callable.rb index 95dbcc71..ea49f2e0 100644 --- a/lib/parfait/callable.rb +++ b/lib/parfait/callable.rb @@ -59,7 +59,7 @@ module Parfait bin = binary while(bin) do block.call( bin ) - bin = bin.next_callable + bin = bin.next_code end end diff --git a/lib/parfait/vool_method.rb b/lib/parfait/vool_method.rb index ef154105..8e3ff8be 100644 --- a/lib/parfait/vool_method.rb +++ b/lib/parfait/vool_method.rb @@ -12,18 +12,19 @@ module Parfait # 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 ) self.name = name self.args_type = args_type self.frame_type = frame_type - self.source = source + @source = source raise "Name must be symbol" unless name.is_a?(Symbol) 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 "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 def create_callable_method( type ) @@ -34,7 +35,7 @@ module Parfait def compiler_for(self_type) callable_method = create_callable_method(self_type) compiler = Risc::MethodCompiler.new( callable_method ) - head = source.to_mom( compiler ) + head = @source.to_mom( compiler ) compiler.add_mom(head) compiler end diff --git a/lib/risc/text_writer.rb b/lib/risc/text_writer.rb index 653ebd92..4602e7af 100644 --- a/lib/risc/text_writer.rb +++ b/lib/risc/text_writer.rb @@ -168,7 +168,7 @@ module Risc def write_BinaryCode( code ) write_ref_for( code.get_type ) - write_ref_for( code.next ) + write_ref_for( code.next_code ) code.each_word do |word| @stream.write_unsigned_int_32( word || 0 ) end diff --git a/test/risc/position/test_instruction_listener1.rb b/test/risc/position/test_instruction_listener1.rb index a9649d8d..391f4a26 100644 --- a/test/risc/position/test_instruction_listener1.rb +++ b/test/risc/position/test_instruction_listener1.rb @@ -18,7 +18,7 @@ module Risc assert_equal 72 , Position.get(@instruction.last).at end def test_next - assert @binary.next + assert @binary.next_code end def test_insert_initializes @instruction.insert DummyInstruction.new