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