refactor load_parfait

so debugger can grab and wire it easily
This commit is contained in:
Torsten Ruger 2015-11-08 18:35:10 +02:00
parent 6f69995284
commit 6b9c472bec

View File

@ -141,11 +141,17 @@ module Soml
end end
def self.load_parfait def self.load_parfait
each_parfait do |parts|
self.new.process( parts )
end
end
def self.each_parfait
["word","class","layout","message" ,"integer", "object"].each do |o| ["word","class","layout","message" ,"integer", "object"].each do |o|
str = File.open(File.expand_path("parfait/#{o}.soml", File.dirname(__FILE__))).read str = File.open(File.expand_path("parfait/#{o}.soml", File.dirname(__FILE__))).read
syntax = Parser::Salama.new.parse_with_debug(str) syntax = Parser::Salama.new.parse_with_debug(str)
parts = Parser::Transform.new.apply(syntax) parts = Parser::Transform.new.apply(syntax)
self.new.process( parts ) yield parts
end end
end end
end end