357{
358 auto actives = section->find("active");
359 auto inactives = section->find("inactive");
360
361 if (actives && inactives && actives->type() == hit::NodeType::Field &&
362 inactives->type() == hit::NodeType::Field && actives->parent() == inactives->parent())
363 {
365 "'active' and 'inactive' parameters both provided in section '" + fullpath + "'", section);
366 return;
367 }
368
369
370 if (actives && actives->type() == hit::NodeType::Field && actives->parent() == section)
371 {
372 auto vars = section->param<std::vector<std::string>>(
"active");
373 std::string msg = "";
374 for (
auto & var :
vars)
375 {
376 if (!section->find(var))
377 msg += var + ", ";
378 }
379 if (msg.size() > 0)
380 {
381 msg = msg.substr(0, msg.size() - 2);
382 errors.emplace_back(
"variables listed as active (" + msg +
") in section '" +
383 section->fullpath() + "' not found in input",
384 section);
385 }
386 }
387
388 if (inactives && inactives->type() == hit::NodeType::Field && inactives->parent() == section)
389 {
390 auto vars = section->param<std::vector<std::string>>(
"inactive");
391 std::string msg = "";
392 for (
auto & var :
vars)
393 {
394 if (!section->find(var))
395 msg += var + ", ";
396 }
397 if (msg.size() > 0)
398 {
399 msg = msg.substr(0, msg.size() - 2);
400 errors.emplace_back(
"variables listed as inactive (" + msg +
") in section '" +
401 section->fullpath() + "' not found in input",
402 section);
403 }
404 }
405}
std::vector< hit::ErrorMessage > errors