@@ -899,14 +899,15 @@ ansi_port_declaration_brace:
899
899
900
900
// append to last one -- required to make
901
901
// the grammar LR1
902
- | ansi_port_declaration_brace ' ,' port_identifier
902
+ | ansi_port_declaration_brace ' ,' port_identifier ansi_port_initializer_opt
903
903
{ $$=$1 ;
904
904
exprt decl (ID_decl);
905
905
decl.add_to_operands (std::move (stack_expr ($3 )));
906
906
// grab the type and class from previous!
907
907
const irept &prev=stack_expr ($$).get_sub ().back ();
908
908
decl.set (ID_type, prev.find (ID_type));
909
909
decl.set (ID_class, prev.find (ID_class));
910
+ decl.set (ID_value, stack_expr ($4 ));
910
911
stack_expr ($$).move_to_sub (decl);
911
912
}
912
913
;
@@ -935,6 +936,7 @@ ansi_port_declaration:
935
936
// and the unpacked_array_type goes onto the declarator.
936
937
stack_expr ($$).type () = std::move (stack_expr ($1 ).type ());
937
938
addswap ($2 , ID_type, $3 );
939
+ stack_expr ($2 ).set (ID_value, stack_expr ($4 ));
938
940
mto ($$, $2 ); /* declarator */ }
939
941
| variable_port_header port_identifier unpacked_dimension_brace ansi_port_initializer_opt
940
942
{ init ($$, ID_decl);
@@ -946,6 +948,7 @@ ansi_port_declaration:
946
948
// and the unpacked_array_type goes onto the declarator.
947
949
stack_expr ($$).type () = std::move (stack_expr ($1 ).type ());
948
950
addswap ($2 , ID_type, $3 );
951
+ stack_expr ($2 ).set (ID_value, stack_expr ($4 ));
949
952
mto ($$, $2 ); /* declarator */ }
950
953
;
951
954
0 commit comments