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 Sep 6, 2024
1 parent 05d9854 commit 6b8c867
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 @@ -10066,7 +10066,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 6b8c867

Please sign in to comment.