Auto-update dlang core files [skip ci]

This commit is contained in:
Gitea Actions Bot committed 2026-10-13 14:14:57 +00:00
1 parent c8a040ed7c
commit 890f4290b6
5 files changed
+21 -10

No files matched your search

+11 -4
View File
@@ -46,10 +46,13 @@ Token& Parser::ShouldBe(TokenType type, const std::string& value)
const auto& current = Current();
if (current.type != type)
throw std::runtime_error("Unexpected type '" + std::string(TokenTypeToString(current.type)) + "' where '" + std::string(TokenTypeToString(type)) + "' should be " + LocationText(current));
throw std::runtime_error("Syntax Error: Expected token type '" + std::string(TokenTypeToString(type)) +
"' but got '" + std::string(TokenTypeToString(current.type)) +
"' (value: '" + current.value + "') " + LocationText(current));
if(!value.empty() && value != current.value)
throw std::runtime_error("Unexpected value '" + current.value + "' where '" + value + "' should be " + LocationText(current));
if (!value.empty() && value != current.value)
throw std::runtime_error("Syntax Error: Expected specific value '" + value +
"' but got '" + current.value + "' " + LocationText(current));
return Consume();
}
@@ -481,7 +484,11 @@ std::unique_ptr<Expression> Parser::ParsePrimary()
return left;
}
throw std::runtime_error("Expected expression " + LocationText(current));
std::string tokenDesc = std::string(TokenTypeToString(current.type));
if (!current.value.empty()) {
tokenDesc += " ('" + current.value + "')";
}
throw std::runtime_error("Expected expression, but found unexpected token type " + tokenDesc + " " + LocationText(current));
}
std::unique_ptr<Expression> Parser::ParseMultiplicative()
+3
View File
@@ -545,6 +545,9 @@ StackValue DlangVM::GetField(const std::string& key, bool popTable)
return it->second;
}
printf("Cant get field on non table type %s!\n", StackValueTypeToString(stackTable.type).c_str());
return StackValue();
}
StackValue DlangVM::GetTableKeys()