add layout and class accessor and test
This commit is contained in:
parent
484e2d19d4
commit
7523bac80a
@ -145,7 +145,7 @@ module Soml
|
||||
end
|
||||
|
||||
def self.load_parfait
|
||||
["object"].each do |o|
|
||||
["layout","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)
|
||||
|
7
lib/soml/parfait/layout.soml
Normal file
7
lib/soml/parfait/layout.soml
Normal file
@ -0,0 +1,7 @@
|
||||
class Layout < Object
|
||||
|
||||
Class object_class()
|
||||
get_internal(1)
|
||||
end
|
||||
|
||||
end
|
@ -1,7 +1,12 @@
|
||||
class Object
|
||||
|
||||
Layout get_layout()
|
||||
return get_internal(1)
|
||||
return get_internal(0)
|
||||
end
|
||||
|
||||
Class get_class()
|
||||
Layout l = get_layout()
|
||||
return l.object_class()
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
require_relative 'helper'
|
||||
|
||||
class TestObject < MiniTest::Test
|
||||
class TestLayoutRT < MiniTest::Test
|
||||
include RuntimeTests
|
||||
|
||||
def test_main
|
||||
@ -13,6 +13,11 @@ class TestObject < MiniTest::Test
|
||||
check
|
||||
end
|
||||
|
||||
def test_get_class
|
||||
@string_input = "return get_class()"
|
||||
check
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user