Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.y:
state_block: %empty
- | state_block state
{
if (!($$ = hlsl_alloc(ctx, sizeof(*$$))))
YYABORT;
}
- | state_block any_identifier '[' C_INTEGER ']' '=' complex_initializer ';'
You could probably avoid the duplication with a separate "%empty | [int]" rule. Or alternatively use "arrays" and add an explicit check for count > 1.
Is C_INTEGER correct here, or should we allow compile-time constants?