Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.y:
| loop_statement
jump_statement:
KW_RETURN expr ';'
KW_BREAK ';'
{
struct hlsl_ir_node *jump;
/* TODO: allow 'break' in the 'switch' statements. */
if (!get_loop_scope(ctx->cur_scope))
{
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, "Incorrect context for a 'break' statement.");
I feel like we could be more specific without losing anything, like, "'break' must be inside of a loop."