diff --git a/lib/base/dynamicobject.ti b/lib/base/dynamicobject.ti index eaab51266..682eb228d 100644 --- a/lib/base/dynamicobject.ti +++ b/lib/base/dynamicobject.ti @@ -5,6 +5,7 @@ abstract class DynamicObject { [config] String name (Name); [config, get_protected] String type (TypeName); + [config, get_protected] Array::Ptr templates; [config] Dictionary::Ptr methods; [config] Dictionary::Ptr custom; [config] Array::Ptr domains; diff --git a/lib/config/base-type.conf b/lib/config/base-type.conf index 1dfdd0a77..66411d726 100644 --- a/lib/config/base-type.conf +++ b/lib/config/base-type.conf @@ -24,6 +24,10 @@ %require "type", %attribute %string "type", + %attribute %array "templates" { + %attribute %string "*" + }, + %attribute %dictionary "methods", %attribute %dictionary "custom" { diff --git a/lib/config/configitembuilder.cpp b/lib/config/configitembuilder.cpp index 0a730b2af..56383b7ef 100644 --- a/lib/config/configitembuilder.cpp +++ b/lib/config/configitembuilder.cpp @@ -86,6 +86,9 @@ ConfigItem::Ptr ConfigItemBuilder::Compile(void) } Array::Ptr exprs = make_shared(); + Array::Ptr templateArray = make_shared(); + templateArray->Add(m_Name); + exprs->Add(make_shared(&AExpression::OpSetPlus, "templates", make_shared(&AExpression::OpLiteral, templateArray, m_DebugInfo), m_DebugInfo)); exprs->Add(make_shared(&AExpression::OpSet, "type", make_shared(&AExpression::OpLiteral, m_Type, m_DebugInfo), m_DebugInfo)); exprs->Add(make_shared(&AExpression::OpDict, m_Expressions, true, m_DebugInfo)); exprs->Add(make_shared(&AExpression::OpSet, "name", make_shared(&AExpression::OpLiteral, m_Name, m_DebugInfo), m_DebugInfo));