1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-01 07:14:31 +00:00

widl: Add basic support for the [deprecated] attribute.

Signed-off-by: Bernhard Kölbl <bkoelbl@codeweavers.com>
This commit is contained in:
Bernhard Kölbl 2023-07-05 16:38:06 +02:00 committed by Alexandre Julliard
parent a6bc5f34b8
commit 711cd500e7
4 changed files with 11 additions and 0 deletions

View File

@ -157,6 +157,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
/* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultvalue" },
/* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "defaultvtable" },
/* ATTR_DEPRECATED */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "deprecated" },
/* ATTR_DISABLECONSISTENCYCHECK */{ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "disable_consistency_check" },
/* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, NULL },
/* ATTR_DISPLAYBIND */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "displaybind" },

View File

@ -258,6 +258,7 @@ static void winrt_enable( int ns_prefix )
defaultcollelem { return tDEFAULTCOLLELEM; }
defaultvalue { return tDEFAULTVALUE; }
defaultvtable { return tDEFAULTVTABLE; }
deprecated { return token_winrt( tDEPRECATED, yytext, yylval ); }
disable_consistency_check { return tDISABLECONSISTENCYCHECK; }
displaybind { return tDISPLAYBIND; }
dllname { return tDLLNAME; }

View File

@ -199,6 +199,7 @@ void pop_import( PARSER_LTYPE *yylloc );
%token tDEFAULTCOLLELEM
%token tDEFAULTVALUE
%token tDEFAULTVTABLE
%token tDEPRECATED
%token tDISABLECONSISTENCYCHECK tDISPLAYBIND
%token tDISPINTERFACE
%token tDLLNAME tDONTFREE tDOUBLE tDUAL
@ -298,6 +299,7 @@ void pop_import( PARSER_LTYPE *yylloc );
%type <expr> static_attr
%type <expr> activatable_attr
%type <expr> composable_attr
%type <expr> deprecated_attr
%type <type> delegatedef
%type <stgclass> storage_cls_spec
%type <type_qualifier> type_qualifier m_type_qual_list
@ -628,6 +630,11 @@ composable_attr
}
;
deprecated_attr
: aSTRING ',' aIDENTIFIER ',' contract_req
{ $$ = make_expr3( EXPR_MEMBER, make_exprs( EXPR_STRLIT, $1 ), make_exprs( EXPR_IDENTIFIER, $3 ), $5 ); }
;
attribute
: %empty { $$ = NULL; }
| tACTIVATABLE '(' activatable_attr ')' { $$ = attr_ptr( @$, ATTR_ACTIVATABLE, $3 ); }
@ -659,6 +666,7 @@ attribute
| tDEFAULTCOLLELEM { $$ = attr_int( @$, ATTR_DEFAULTCOLLELEM, 0 ); }
| tDEFAULTVALUE '(' expr_const ')' { $$ = attr_ptr( @$, ATTR_DEFAULTVALUE, $3 ); }
| tDEFAULTVTABLE { $$ = attr_int( @$, ATTR_DEFAULTVTABLE, 0 ); }
| tDEPRECATED '(' deprecated_attr ')' { $$ = attr_ptr( @$, ATTR_DEPRECATED, $3 ); }
| tDISABLECONSISTENCYCHECK { $$ = attr_int( @$, ATTR_DISABLECONSISTENCYCHECK, 0 ); }
| tDISPLAYBIND { $$ = attr_int( @$, ATTR_DISPLAYBIND, 0 ); }
| tDLLNAME '(' aSTRING ')' { $$ = attr_ptr( @$, ATTR_DLLNAME, $3 ); }

View File

@ -96,6 +96,7 @@ enum attr_type
ATTR_DEFAULTCOLLELEM,
ATTR_DEFAULTVALUE,
ATTR_DEFAULTVTABLE,
ATTR_DEPRECATED,
ATTR_DISABLECONSISTENCYCHECK,
ATTR_DISPINTERFACE,
ATTR_DISPLAYBIND,