Don't parse expression on different line from return keyword
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-19 16:21:21 +02:00
parent b76548da16
commit 6f7d319148
4 changed files with 24 additions and 2 deletions

View File

@@ -136,5 +136,19 @@ test()
delete script;
}
TEST_CASE( "Return doesn't parse next line expression", "[integration]" ) {
Script* script = Script::Create(
R"(
return
1 + 1
)"
);
REQUIRE(!script->Diagnostics -> HasErrors());
auto result = script->Evaluate();
REQUIRE(result == nullptr);
delete script;
}
#endif