From 50b03a5e942edc3b62ef4c98df96b763fc61045b Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sat, 7 Nov 2015 17:38:27 +0200 Subject: [PATCH] load parfait soml files No dir glob for precise order --- lib/soml/compiler.rb | 9 +++++++++ lib/soml/parfait/object.soml | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 lib/soml/parfait/object.soml diff --git a/lib/soml/compiler.rb b/lib/soml/compiler.rb index 19ca9fe5..3349c8c9 100644 --- a/lib/soml/compiler.rb +++ b/lib/soml/compiler.rb @@ -143,6 +143,15 @@ module Soml raise "space is a reserved name" if name == :space name end + + def self.load_parfait + ["object"].each do |o| + str = File.open(File.expand_path("parfait/#{o}.soml", File.dirname(__FILE__))).read + syntax = Parser::Salama.new.parse_with_debug(str) + parts = Parser::Transform.new.apply(syntax) + self.new.process( parts ) + end + end end end diff --git a/lib/soml/parfait/object.soml b/lib/soml/parfait/object.soml new file mode 100644 index 00000000..6821dcad --- /dev/null +++ b/lib/soml/parfait/object.soml @@ -0,0 +1,7 @@ +class Object + + Layout get_layout() + return get_internal(1) + end + +end