#include <Parser.h>
|
| virtual void | walk (const std::string &fullpath, const std::string &, hit::Node *n) override |
| |
|
| std::vector< hit::ErrorMessage > | errors |
| |
|
| std::map< std::string, hit::Node * > | _have |
| |
Definition at line 57 of file Parser.h.
◆ walk()
| void DupParamWalker::walk |
( |
const std::string & |
fullpath, |
|
|
const std::string & |
, |
|
|
hit::Node * |
n |
|
) |
| |
|
overridevirtual |
Definition at line 308 of file Parser.C.
309{
310 const auto it =
_have.try_emplace(fullpath, n);
311 if (!it.second)
312 {
313 const std::string type = n->type() == hit::NodeType::Field ? "parameter" : "section";
314 const std::string error = type + " '" + fullpath + "' supplied multiple times";
315
316
317 const auto existing = it.first->second;
318 if (std::find_if(
errors.begin(),
320 [&existing](const auto & err)
321 { return err.node == existing; }) ==
errors.end())
322 errors.emplace_back(error, existing);
323
324 errors.emplace_back(error, n);
325 }
326}
std::map< std::string, hit::Node * > _have
std::vector< hit::ErrorMessage > errors
Referenced by Parser::parse().
◆ _have
| std::map<std::string, hit::Node *> DupParamWalker::_have |
|
private |
◆ errors
| std::vector<hit::ErrorMessage> DupParamWalker::errors |
The documentation for this class was generated from the following files: