29 Jun
2023
29 Jun
'23
4:55 p.m.
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." -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/245#note_37346