Skip to content

Commit

Permalink
[Shaders] Disallow trailing commas in function declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
AThousandShips committed Jan 15, 2025
1 parent 4ce466d commit 52b2649
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion servers/rendering/shader_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10557,7 +10557,13 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f

if (tk.type == TK_COMMA) {
tk = _get_token();
//do none and go on
#ifdef DISABLE_DEPRECATED
// Disallow trailing comma.
if (tk.type == TK_PARENTHESIS_CLOSE) {
_set_error(RTR("Expected a valid data type for argument. Trailing commas are not allowed."));
return ERR_PARSE_ERROR;
}
#endif
} else if (tk.type != TK_PARENTHESIS_CLOSE) {
_set_expected_error(",", ")");
return ERR_PARSE_ERROR;
Expand Down

0 comments on commit 52b2649

Please sign in to comment.