mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
parent
7d972b8c67
commit
ebade0e454
3 changed files with 8 additions and 8 deletions
|
@ -1501,12 +1501,9 @@ GDScriptParser::AssertNode *GDScriptParser::parse_assert() {
|
|||
|
||||
if (match(GDScriptTokenizer::Token::COMMA)) {
|
||||
// Error message.
|
||||
if (consume(GDScriptTokenizer::Token::LITERAL, R"(Expected error message for assert after ",".)")) {
|
||||
assert->message = parse_literal();
|
||||
if (assert->message->value.get_type() != Variant::STRING) {
|
||||
push_error(R"(Expected string for assert error message.)");
|
||||
}
|
||||
} else {
|
||||
assert->message = parse_expression(false);
|
||||
if (assert->message == nullptr) {
|
||||
push_error(R"(Expected error message for assert after ",".)");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue