Skip to content

Commit 5f45a2c

Browse files
author
AndyZe
committed
Additional XML verification for Control nodes
1 parent 2bc72fd commit 5f45a2c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/xml_parsing.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,18 @@ void VerifyXML(const std::string& xml_text,
541541
ThrowError(line_number,
542542
std::string("The node <") + name + "> must have 1 or more children");
543543
}
544+
if (name == "ReactiveSequence")
545+
{
546+
const std::string child_name = node->FirstChildElement()->Name();
547+
const auto child_search = registered_nodes.find(child_name);
548+
auto child_type = child_search->second;
549+
// TODO: what this really needs to check is if the child is async
550+
if (child_type != NodeType::CONDITION)
551+
{
552+
ThrowError(line_number,
553+
std::string("The first child of a ReactiveSequence cannot be asynchronous"));
554+
}
555+
}
544556
}
545557
}
546558
//recursion

0 commit comments

Comments
 (0)