Dan Hipschman : widl: Allow trailing commas in attribute lists.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 26 04:22:46 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 3b3632a1cd0e8c4633f00ac97325e583ebadaf60
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=3b3632a1cd0e8c4633f00ac97325e583ebadaf60

Author: Dan Hipschman <dsh at linux.ucla.edu>
Date:   Tue Jul 25 12:00:49 2006 -0700

widl: Allow trailing commas in attribute lists.

---

 tools/widl/parser.y |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index a7b1269..1790985 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -343,16 +343,23 @@ m_attributes:					{ $$ = NULL; }
 	;
 
 attributes:
-	  '[' attrib_list ']'			{ $$ = $2; }
+	  '[' attrib_list ']'			{ $$ = $2;
+						  if (!$$)
+						    yyerror("empty attribute lists unsupported");
+						}
 	;
 
 attrib_list: attribute
-	| attrib_list ',' attribute		{ LINK($3, $1); $$ = $3; }
-	| attrib_list ']' '[' attribute		{ LINK($4, $1); $$ = $4; }
+	| attrib_list ',' attribute		{ if ($3) { LINK($3, $1); $$ = $3; }
+						  else { $$ = $1; }
+						}
+	| attrib_list ']' '[' attribute		{ if ($4) { LINK($4, $1); $$ = $4; }
+						  else { $$ = $1; }
+						}
 	;
 
-attribute:
-	  tAGGREGATABLE				{ $$ = make_attr(ATTR_AGGREGATABLE); }
+attribute:					{ $$ = NULL; }
+	| tAGGREGATABLE				{ $$ = make_attr(ATTR_AGGREGATABLE); }
 	| tAPPOBJECT				{ $$ = make_attr(ATTR_APPOBJECT); }
 	| tASYNC				{ $$ = make_attr(ATTR_ASYNC); }
 	| tAUTOHANDLE				{ $$ = make_attr(ATTR_AUTO_HANDLE); }




More information about the wine-cvs mailing list