fix yaml array parsing
This commit is contained in:
parent
5755c616f3
commit
026ae756cf
@ -139,8 +139,12 @@ void BasicParser<CharT>::skipLine() {
|
|||||||
|
|
||||||
template<typename CharT>
|
template<typename CharT>
|
||||||
void BasicParser<CharT>::skipEmptyLines() {
|
void BasicParser<CharT>::skipEmptyLines() {
|
||||||
|
if (!hasNext()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
size_t initpos = pos;
|
||||||
skipWhitespace();
|
skipWhitespace();
|
||||||
pos = linestart;
|
pos = std::max<size_t>(initpos, linestart);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename CharT>
|
template<typename CharT>
|
||||||
|
|||||||
@ -270,6 +270,10 @@ dv::value Parser::parseArray(int indent) {
|
|||||||
dv::value object = dv::object();
|
dv::value object = dv::object();
|
||||||
object[std::string(name)] = parseFullValue(next_indent);
|
object[std::string(name)] = parseFullValue(next_indent);
|
||||||
skipEmptyLines();
|
skipEmptyLines();
|
||||||
|
if (!hasNext()) {
|
||||||
|
list.add(std::move(object));
|
||||||
|
break;
|
||||||
|
}
|
||||||
next_indent = countIndent();
|
next_indent = countIndent();
|
||||||
if (next_indent > indent) {
|
if (next_indent > indent) {
|
||||||
pos = linestart;
|
pos = linestart;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user