summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-12 00:05:08 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-12 00:05:08 +0100
commit339683e64288a85b8d6f9355a10563417b7d2fa7 (patch)
tree3710c4bd2d811780dd6b4a7a6394ade41a9dd6b9 /src/plugins
parent7daed2f8431e89e2bd041a54bc1bef8c45329092 (diff)
addes special resolve case in ParserScope::resolve for default field descriptors and changed resolve mechanism in parent field refs to just asking for the FieldDescriptor with the given name.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/xml/XmlParser.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/plugins/xml/XmlParser.cpp b/src/plugins/xml/XmlParser.cpp
index d7efa4d..e0346ab 100644
--- a/src/plugins/xml/XmlParser.cpp
+++ b/src/plugins/xml/XmlParser.cpp
@@ -785,16 +785,14 @@ public:
Handle<Node> strct,
Logger &logger) {
if (parent != nullptr) {
- auto res = parent.cast<Descriptor>()->resolve(
- &RttiTypes::FieldDescriptor, name);
- if (res.size() != 1) {
+ Rooted<FieldDescriptor> field =
+ parent.cast<Descriptor>()->getFieldDescriptor(name);
+ if (field == nullptr) {
logger.error(
std::string("Could not find referenced field ") + name,
loc);
return;
}
- Rooted<FieldDescriptor> field =
- res[0].node.cast<FieldDescriptor>();
field->addChild(strct.cast<StructuredClass>());
}
});
@@ -985,10 +983,9 @@ static const ParserState DomainStructPrimitive =
.parents({&DomainStruct, &DomainAnnotation})
.createdNodeType(&RttiTypes::FieldDescriptor)
.elementHandler(DomainPrimitiveHandler::create)
- .arguments({Argument::String("name", ""),
- Argument::Bool("isSubtree", false),
- Argument::Bool("optional", false),
- Argument::String("type")});
+ .arguments(
+ {Argument::String("name", ""), Argument::Bool("isSubtree", false),
+ Argument::Bool("optional", false), Argument::String("type")});
static const ParserState DomainStructChild =
ParserStateBuilder()