Commit 711cd500 authored by Bernhard Kölbl's avatar Bernhard Kölbl Committed by Alexandre Julliard

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

parent a6bc5f34
......@@ -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" },
......
......@@ -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; }
......
......@@ -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 ); }
......
......@@ -96,6 +96,7 @@ enum attr_type
ATTR_DEFAULTCOLLELEM,
ATTR_DEFAULTVALUE,
ATTR_DEFAULTVTABLE,
ATTR_DEPRECATED,
ATTR_DISABLECONSISTENCYCHECK,
ATTR_DISPINTERFACE,
ATTR_DISPLAYBIND,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment