|
From: | Gopal.V <address@hidden> |
Subject: | [Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_decls.tc,1.37,1.38 cs_grammar.y,1.59,1.60 |
Date: | Sun, 01 Jun 2003 02:47:01 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/cscc/csharp In directory subversions:/tmp/cvs-serv19133/cscc/csharp Modified Files: cs_decls.tc cs_grammar.y Log Message: Errors for multiple static ctors and static ctors with parameters Index: cs_decls.tc =================================================================== RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_decls.tc,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** cs_decls.tc 9 Mar 2003 10:05:57 -0000 1.37 --- cs_decls.tc 1 Jun 2003 06:46:59 -0000 1.38 *************** *** 116,119 **** --- 116,121 ---- ILNode *staticCtorList=NULL; ILNode *savedTypeFormals; + ILNode_ListIter iter; + ILNode *staticCtor; int hadStaticCtorsBefore; int target; *************** *** 199,202 **** --- 201,216 ---- if (node->staticCtors) { + if(ILNode_List_Length(node->staticCtors)>1) + { + ILNode_ListIter_Init(&iter, node->staticCtors); + ILNode_ListIter_Next(&iter); /* skip the first */ + while((staticCtor=ILNode_ListIter_Next(&iter))!=NULL) + { + CCErrorOnLine(yygetfilename(staticCtor), + yygetlinenum(staticCtor), + "Cannot have more than one static " + "constructor"); + } + } staticCtorList=node->staticCtors; } Index: cs_grammar.y =================================================================== RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_grammar.y,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -r1.59 -r1.60 *** cs_grammar.y 29 May 2003 20:59:27 -0000 1.59 --- cs_grammar.y 1 Jun 2003 06:46:59 -0000 1.60 *************** *** 3412,3415 **** --- 3412,3420 ---- if((attrs & IL_META_METHODDEF_STATIC) != 0) { + if(!yyisa($5,ILNode_Empty)) + { + CCErrorOnLine(yygetfilename($3), yygetlinenum($3), + "Static constructors cannot have parameters"); + } $$.body = 0; $$.staticCtors = body;
[Prev in Thread] | Current Thread | [Next in Thread] |