From 426c08eba4aefc0b3cae800c7e78c2a7b4306fb3 Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Wed, 30 Mar 2022 23:38:28 +0200 Subject: [PATCH] vkd3d-shader/hlsl: Add 'braces' flag to parse initializers. Signed-off-by: Francisco Casas Signed-off-by: Zebediah Figura Signed-off-by: Giovanni Mascellani Signed-off-by: Matteo Bruni Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d-shader/hlsl.y | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 8f8b3c35..6fcacc67 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -48,6 +48,7 @@ struct parse_initializer struct hlsl_ir_node **args; unsigned int args_count; struct list *instrs; + bool braces; }; struct parse_array_sizes @@ -3215,14 +3216,17 @@ complex_initializer: } $$.args[0] = node_from_list($1); $$.instrs = $1; + $$.braces = false; } | '{' complex_initializer_list '}' { $$ = $2; + $$.braces = true; } | '{' complex_initializer_list ',' '}' { $$ = $2; + $$.braces = true; } complex_initializer_list: @@ -3260,6 +3264,7 @@ initializer_expr_list: } $$.args[0] = node_from_list($1); $$.instrs = $1; + $$.braces = false; } | initializer_expr_list ',' initializer_expr { @@ -3396,6 +3401,7 @@ func_arguments: $$.args_count = 0; if (!($$.instrs = make_empty_list(ctx))) YYABORT; + $$.braces = false; } | initializer_expr_list