still some names that needed changing
This commit is contained in:
parent
25d7b8bd83
commit
fee9e261a5
@ -59,7 +59,7 @@ module Parfait
|
||||
bin = binary
|
||||
while(bin) do
|
||||
block.call( bin )
|
||||
bin = bin.next_callable
|
||||
bin = bin.next_code
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user