diff --git a/include/core/yaml/parser_yaml.hpp b/include/core/yaml/parser_yaml.hpp index 0569abc11b3e4216ab3e20bc1bf84e9dc17a11be..ffda58f9160a537f047c5432edced449b7a305da 100644 --- a/include/core/yaml/parser_yaml.hpp +++ b/include/core/yaml/parser_yaml.hpp @@ -248,7 +248,7 @@ public: std::vector<std::array<std::string, 3>> getCallbacks(); std::vector<std::array<std::string, 2>> getProblem(); std::map<std::string,std::string> getParams(); - void parse(); + void parse(bool); }; std::string ParserYAML::generatePath(std::string path){ std::regex r("^/.*"); @@ -439,9 +439,10 @@ std::map<std::string,std::string> ParserYAML::getParams(){ std::map<std::string,std::string> rtn = _params; return rtn; } -void ParserYAML::parse(){ +void ParserYAML::parse(bool freely_parse = false){ this->_parsing_file.push(generatePath(this->_file)); - this->parseFirstLevel(this->_file); + if(not freely_parse){ + this->parseFirstLevel(this->_file); if(this->problem.Type() != YAML::NodeType::Undefined){ std::vector<std::string> tags = std::vector<std::string>(); @@ -455,6 +456,10 @@ void ParserYAML::parse(){ std::vector<std::string> tags = std::vector<std::string>(); this->walkTreeR(it.n , tags , it._name); } + }else{ + std::vector<std::string> tags = std::vector<std::string>(); + this->walkTreeR(loadYAML(this->_file), tags, ""); + } this->_parsing_file.pop(); } #endif