1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-05 17:28:47 +00:00

widl: Allow using UDTs with the keyword even when the identifier is also a typedef.

E.g. in cases like

    typedef int apple;
    struct apple { ... };

allow subsequently using "struct apple" in future expressions.
Note that this already worked for UDT definitions (so the above example by
itself was legal in widl), but any attempt to use the defined type would result
in a syntax error.
This commit is contained in:
Elizabeth Figura 2024-03-25 15:21:44 -05:00 committed by Alexandre Julliard
parent 07243c4e12
commit 9839a0d68d

View File

@ -500,11 +500,11 @@ warnings:
typedecl:
enumdef
| tENUM aIDENTIFIER { $$ = type_new_enum($2, current_namespace, FALSE, NULL); }
| tENUM typename { $$ = type_new_enum($2, current_namespace, FALSE, NULL); }
| structdef
| tSTRUCT aIDENTIFIER { $$ = type_new_struct($2, current_namespace, FALSE, NULL); }
| tSTRUCT typename { $$ = type_new_struct($2, current_namespace, FALSE, NULL); }
| uniondef
| tUNION aIDENTIFIER { $$ = type_new_nonencapsulated_union($2, current_namespace, FALSE, NULL); }
| tUNION typename { $$ = type_new_nonencapsulated_union($2, current_namespace, FALSE, NULL); }
| attributes enumdef { $$ = $2; $$->attrs = check_enum_attrs($1); }
| attributes structdef { $$ = $2; $$->attrs = check_struct_attrs($1); }
| attributes uniondef { $$ = $2; $$->attrs = check_union_attrs($1); }
@ -1338,17 +1338,17 @@ structdef: tSTRUCT m_typename '{' fields '}' { $$ = type_new_struct($2, current_
;
unqualified_type:
tVOID { $$ = type_new_void(); }
| base_type { $$ = $1; }
| enumdef { $$ = $1; }
| tENUM aIDENTIFIER { $$ = type_new_enum($2, current_namespace, FALSE, NULL); }
| structdef { $$ = $1; }
| tSTRUCT aIDENTIFIER { $$ = type_new_struct($2, current_namespace, FALSE, NULL); }
| uniondef { $$ = $1; }
| tUNION aIDENTIFIER { $$ = type_new_nonencapsulated_union($2, current_namespace, FALSE, NULL); }
| tSAFEARRAY '(' type ')' { $$ = make_safearray($3); }
| aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); }
;
tVOID { $$ = type_new_void(); }
| base_type { $$ = $1; }
| enumdef { $$ = $1; }
| tENUM typename { $$ = type_new_enum($2, current_namespace, FALSE, NULL); }
| structdef { $$ = $1; }
| tSTRUCT typename { $$ = type_new_struct($2, current_namespace, FALSE, NULL); }
| uniondef { $$ = $1; }
| tUNION typename { $$ = type_new_nonencapsulated_union($2, current_namespace, FALSE, NULL); }
| tSAFEARRAY '(' type ')' { $$ = make_safearray($3); }
| aKNOWNTYPE { $$ = find_type_or_error(current_namespace, $1); }
;
type:
unqualified_type