moved sod write method to module

This commit is contained in:
Torsten Ruger 2015-06-19 12:29:41 +03:00
parent 1baece99c7
commit 87143091ca
7 changed files with 8 additions and 8 deletions

View File

@ -43,7 +43,7 @@ module Parfait
found = get_instance_method( method.name ) found = get_instance_method( method.name )
if found if found
@instance_methods.delete(found) @instance_methods.delete(found)
raise "existed in #{self.name} #{Sof::Writer.write found.info.blocks}" raise "existed in #{self.name} #{Sof.write found.info.blocks}"
end end
@instance_methods.push method @instance_methods.push method
#puts "#{self.name} add #{method.name}" #puts "#{self.name} add #{method.name}"

View File

@ -100,8 +100,8 @@ module Register
begin begin
code.assemble( stream ) code.assemble( stream )
rescue => e rescue => e
puts "Method error #{method.name}\n#{Sof::Writer.write(method.info.blocks).to_s[0...2000]}" puts "Method error #{method.name}\n#{Sof.write(method.info.blocks).to_s[0...2000]}"
puts Sof::Writer.write(code) puts Sof.write(code)
raise e raise e
end end
end end

View File

@ -72,7 +72,7 @@ module Virtual
end end
def to_s def to_s
Sof::Writer.write(self) Sof.write(self)
end end
private private

View File

@ -10,7 +10,7 @@ module Virtual
class Instruction class Instruction
def to_s def to_s
Sof::Writer.write(self) Sof.write(self)
end end
end end

View File

@ -126,7 +126,7 @@ module Parfait
end end
def to_s def to_s
Sof::Writer.write(self) Sof.write(self)
end end
def inspect def inspect
to_s to_s

View File

@ -7,7 +7,7 @@ class HelloTest < MiniTest::Test
machine = Virtual::Machine.boot machine = Virtual::Machine.boot
expressions = machine.compile_main @string_input expressions = machine.compile_main @string_input
machine.run_before "Register::CallImplementation" machine.run_before "Register::CallImplementation"
puts Sof::Writer.write(machine.space) puts Sof.write(machine.space)
machine.run_after "Register::CallImplementation" machine.run_after "Register::CallImplementation"

View File

@ -21,7 +21,7 @@ module VirtualHelper
# with the class comes superclass and all methods # with the class comes superclass and all methods
expressions.first.type.instance_variable_set :@of_class , nil expressions.first.type.instance_variable_set :@of_class , nil
end end
is = Sof::Writer.write(expressions) is = Sof.write(expressions)
#puts is #puts is
is.gsub!("\n" , "*^*") is.gsub!("\n" , "*^*")
assert_equal is , @output assert_equal is , @output