| 11 | namespace { |
| 12 | |
| 13 | std::string parser_error_message(const yaml_parser_t & parser) { |
| 14 | std::ostringstream message; |
| 15 | message << "yaml parse error"; |
| 16 | if (parser.problem != nullptr) { |
| 17 | message << ": " << parser.problem; |
| 18 | } |
| 19 | if (parser.problem_mark.line != 0 || parser.problem_mark.column != 0 || parser.problem_mark.index != 0) { |
| 20 | message << " at line " << (parser.problem_mark.line + 1) |
| 21 | << ", column " << (parser.problem_mark.column + 1); |
| 22 | } |
| 23 | return message.str(); |
| 24 | } |
| 25 | |
| 26 | const yaml_node_t & require_node(yaml_document_t & document, int index, const std::string & context) { |
| 27 | yaml_node_t * node = yaml_document_get_node(&document, index); |
no test coverage detected