From 017213e11a52c30a39d70eeac9c5dbd4a5e2c450 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Tue, 29 Apr 2008 20:40:48 +0100 Subject: [PATCH] widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements. --- tools/widl/parser.y | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 8c99da44f94..b5e95cc2894 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -602,8 +602,9 @@ case: tCASE expr_int_const ':' union_field { attr_t *a = make_attrp(ATTR_CASE, } ; -constdef: tCONST decl_spec ident '=' expr_const { $$ = reg_const($3); - set_type($$, $2, NULL, FALSE); +constdef: tCONST decl_spec declarator '=' expr_const + { $$ = reg_const($3->var); + set_type($$, $2, $3, FALSE); $$->eval = $5; } ; @@ -720,8 +721,8 @@ expr_const: expr { $$ = $1; } ; -externdef: tEXTERN tCONST decl_spec ident { $$ = $4; - set_type($$, $3, NULL, FALSE); +externdef: tEXTERN tCONST decl_spec declarator { $$ = $4->var; + set_type($$, $3, $4, FALSE); } ;