fix: missing yaml null literals

This commit is contained in:
MihailRis 2025-10-13 12:29:09 +03:00
parent 963cedf2b8
commit 5755c616f3

View File

@ -38,7 +38,7 @@ static dv::value perform_literal(std::string_view literal) {
literal == "false" || literal == "False") { literal == "false" || literal == "False") {
return literal[0] == 't'; return literal[0] == 't';
} }
if (literal == "null" || literal == "Null") { if (literal == "null" || literal == "Null" || literal == "~") {
return nullptr; return nullptr;
} }
return std::string(literal); return std::string(literal);
@ -204,8 +204,9 @@ dv::value Parser::parseFullValue(int indent) {
skipEmptyLines(); skipEmptyLines();
int init_pos = pos; int init_pos = pos;
int next_indent = countIndent(); int next_indent = countIndent();
if (next_indent < indent) { if (next_indent <= indent) {
throw error("indentation error"); pos = init_pos;
return nullptr;
} }
if (source[pos] == '-') { if (source[pos] == '-') {
pos = init_pos; pos = init_pos;