285{
286 auto actives = section->find("active");
287 auto inactives = section->find("inactive");
288
289 if (actives && inactives && actives->type() == hit::NodeType::Field &&
290 inactives->type() == hit::NodeType::Field && actives->parent() == inactives->parent())
291 {
293 "'active' and 'inactive' parameters both provided in section '" + fullpath + "'", section);
294 return;
295 }
296
297
298 if (actives && actives->type() == hit::NodeType::Field && actives->parent() == section)
299 {
300 auto vars = section->param<std::vector<std::string>>(
"active");
301 std::string msg = "";
302 for (
auto & var :
vars)
303 {
304 if (!section->find(var))
305 msg += var + ", ";
306 }
307 if (msg.size() > 0)
308 {
309 msg = msg.substr(0, msg.size() - 2);
310 errors.emplace_back(
"variables listed as active (" + msg +
") in section '" +
311 section->fullpath() + "' not found in input",
312 section);
313 }
314 }
315
316 if (inactives && inactives->type() == hit::NodeType::Field && inactives->parent() == section)
317 {
318 auto vars = section->param<std::vector<std::string>>(
"inactive");
319 std::string msg = "";
320 for (
auto & var :
vars)
321 {
322 if (!section->find(var))
323 msg += var + ", ";
324 }
325 if (msg.size() > 0)
326 {
327 msg = msg.substr(0, msg.size() - 2);
328 errors.emplace_back(
"variables listed as inactive (" + msg +
") in section '" +
329 section->fullpath() + "' not found in input",
330 section);
331 }
332 }
333}
std::vector< hit::ErrorMessage > errors