#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 50 of file Parser.h.
◆ walk()
| void DupParamWalker::walk |
( |
const std::string & |
fullpath, |
|
|
const std::string & |
, |
|
|
hit::Node * |
n |
|
) |
| |
|
overridevirtual |
Definition at line 236 of file Parser.C.
237{
238 const auto it =
_have.try_emplace(fullpath, n);
239 if (!it.second)
240 {
241 const std::string type = n->type() == hit::NodeType::Field ? "parameter" : "section";
242 const std::string error = type + " '" + fullpath + "' supplied multiple times";
243
244
245 const auto existing = it.first->second;
246 if (std::find_if(
errors.begin(),
248 [&existing](const auto & err)
249 { return err.node == existing; }) ==
errors.end())
250 errors.emplace_back(error, existing);
251
252 errors.emplace_back(error, n);
253 }
254}
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: