Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 629

Show
Ignore:
Timestamp:
08/26/10 18:21:45 (14 years ago)
Author:
walter
Message:

bugfixes part of Bugzilla 4713 PATCH for interface generation: cleanup, bugfixes and prettyprinting

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmd-1.x/src/attrib.c

    r513 r629  
    306306 */ 
    307307 
    308308void AttribDeclaration::addLocalClass(ClassDeclarations *aclasses) 
    309309{ 
    310310    Array *d = include(NULL, NULL); 
    311311 
    312312    if (d) 
    313313    { 
    314314        for (unsigned i = 0; i < d->dim; i++) 
    315315        {   Dsymbol *s = (Dsymbol *)d->data[i]; 
    316316            s->addLocalClass(aclasses); 
    317317        } 
    318318    } 
    319319} 
    320320 
    321321 
    322322void AttribDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) 
    323323{ 
    324324    if (decl) 
    325325    { 
    326         buf->writenl(); 
    327         buf->writeByte('{'); 
    328         buf->writenl(); 
    329         for (unsigned i = 0; i < decl->dim; i++) 
    330         { 
    331             Dsymbol *s = (Dsymbol *)decl->data[i]; 
    332  
    333             buf->writestring("    "); 
    334             s->toCBuffer(buf, hgs); 
    335         } 
    336         buf->writeByte('}'); 
     326        if (decl->dim == 0) 
     327            buf->writestring("{}"); 
     328        else if (decl->dim == 1) 
     329            ((Dsymbol *)decl->data[0])->toCBuffer(buf, hgs); 
     330        else 
     331        { 
     332            buf->writenl(); 
     333            buf->writeByte('{'); 
     334            buf->writenl(); 
     335            for (unsigned i = 0; i < decl->dim; i++) 
     336            { 
     337                Dsymbol *s = (Dsymbol *)decl->data[i]; 
     338 
     339                buf->writestring("    "); 
     340                s->toCBuffer(buf, hgs); 
     341            } 
     342            buf->writeByte('}'); 
     343        } 
    337344    } 
    338345    else 
    339346        buf->writeByte(';'); 
    340347    buf->writenl(); 
    341348} 
    342349 
    343350/************************* StorageClassDeclaration ****************************/ 
    344351 
    345352StorageClassDeclaration::StorageClassDeclaration(StorageClass stc, Array *decl) 
    346353        : AttribDeclaration(decl) 
    347354{ 
    348355    this->stc = stc; 
    349356} 
    350357 
    351358Dsymbol *StorageClassDeclaration::syntaxCopy(Dsymbol *s) 
    352359{ 
    353360    StorageClassDeclaration *scd; 
    354361 
    355362    assert(!s); 
    356363    scd = new StorageClassDeclaration(stc, Dsymbol::arraySyntaxCopy(decl)); 
  • branches/dmd-1.x/src/expression.c

    r590 r629  
    745745            break; 
    746746    } 
    747747 
    748748    // If D linkage and variadic, add _arguments[] as first argument 
    749749    if (tf->linkage == LINKd && tf->varargs == 1) 
    750750    { 
    751751        assert(arguments->dim >= nparams); 
    752752        Expression *e = createTypeInfoArray(sc, (Expression **)&arguments->data[nparams], 
    753753                arguments->dim - nparams); 
    754754        arguments->insert(0, e); 
    755755    } 
    756756} 
    757757 
    758758/************************************************** 
    759759 * Write expression out to buf, but wrap it 
    760760 * in ( ) if its precedence is less than pr. 
    761761 */ 
    762762 
    763763void expToCBuffer(OutBuffer *buf, HdrGenState *hgs, Expression *e, enum PREC pr) 
    764764{ 
     765#ifdef DEBUG 
     766    if (precedence[e->op] == PREC_zero) 
     767        printf("precedence not defined for token '%s'\n",Token::tochars[e->op]); 
     768#endif 
     769    assert(precedence[e->op] != PREC_zero); 
     770    assert(pr != PREC_zero); 
     771 
    765772    //if (precedence[e->op] == 0) e->dump(0); 
    766773    if (precedence[e->op] < pr || 
    767774        /* Despite precedence, we don't allow a<b<c expressions. 
    768775         * They must be parenthesized. 
    769776         */ 
    770777        (pr == PREC_rel && precedence[e->op] == pr)) 
    771778    { 
    772779        buf->writeByte('('); 
    773780        e->toCBuffer(buf, hgs); 
    774781        buf->writeByte(')'); 
    775782    } 
    776783    else 
    777784        e->toCBuffer(buf, hgs); 
    778785} 
    779786 
    780787/************************************************** 
    781788 * Write out argument list to buf. 
    782789 */ 
    783790 
    784791void argsToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *hgs) 
     
    67846791    else 
    67856792#endif 
    67866793        return Expression::toLvalue(sc, e); 
    67876794} 
    67886795 
    67896796Expression *CallExp::modifiableLvalue(Scope *sc, Expression *e) 
    67906797{ 
    67916798#if 1 
    67926799    return Expression::modifiableLvalue(sc, e); 
    67936800#else 
    67946801    /* Although function return values being usable as "ref" parameters is 
    67956802     * unsound, disabling it breaks existing code. 
    67966803     * Bugzilla 3167 
    67976804     */ 
    67986805    error("cannot assign to function call"); 
    67996806    return toLvalue(sc, e); 
    68006807#endif 
    68016808} 
    68026809 
    68036810void CallExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs) 
    6804 {   int i; 
    6805  
    6806     expToCBuffer(buf, hgs, e1, precedence[op]); 
     6811
     6812    if (e1->op == TOKtype) 
     6813        /* Avoid parens around type to prevent forbidden cast syntax: 
     6814         *   (sometype)(arg1) 
     6815         * This is ok since types in constructor calls 
     6816         * can never depend on parens anyway 
     6817         */ 
     6818        e1->toCBuffer(buf, hgs); 
     6819    else 
     6820        expToCBuffer(buf, hgs, e1, precedence[op]); 
    68076821    buf->writeByte('('); 
    68086822    argsToCBuffer(buf, arguments, hgs); 
    68096823    buf->writeByte(')'); 
    68106824} 
    68116825 
    68126826 
    68136827/************************************************************/ 
    68146828 
    68156829AddrExp::AddrExp(Loc loc, Expression *e) 
    68166830        : UnaExp(loc, TOKaddress, sizeof(AddrExp), e) 
    68176831{ 
    68186832} 
    68196833 
    68206834Expression *AddrExp::semantic(Scope *sc) 
    68216835{ 
    68226836#if LOGSEMANTIC 
    68236837    printf("AddrExp::semantic('%s')\n", toChars()); 
    68246838#endif 
    68256839    if (!type) 
    68266840    { 
  • branches/dmd-1.x/src/parse.c

    r588 r629  
    54475447    return e; 
    54485448} 
    54495449 
    54505450/********************************************** 
    54515451 */ 
    54525452 
    54535453void Parser::addComment(Dsymbol *s, unsigned char *blockComment) 
    54545454{ 
    54555455    s->addComment(combineComments(blockComment, token.lineComment)); 
    54565456    token.lineComment = NULL; 
    54575457} 
    54585458 
    54595459/********************************** 
    54605460 * Set operator precedence for each operator. 
    54615461 */ 
    54625462 
    54635463enum PREC precedence[TOKMAX]; 
    54645464 
    54655465void initPrecedence() 
    54665466{ 
     5467    for (int i = 0; i < TOKMAX; i++) 
     5468        precedence[i] = PREC_zero; 
     5469 
     5470    precedence[TOKtype] = PREC_expr; 
     5471    precedence[TOKerror] = PREC_expr; 
     5472 
     5473    precedence[TOKtypeof] = PREC_primary; 
     5474    precedence[TOKmixin] = PREC_primary; 
     5475 
    54675476    precedence[TOKdotvar] = PREC_primary; 
    54685477    precedence[TOKimport] = PREC_primary; 
    54695478    precedence[TOKidentifier] = PREC_primary; 
    54705479    precedence[TOKthis] = PREC_primary; 
    54715480    precedence[TOKsuper] = PREC_primary; 
    54725481    precedence[TOKint64] = PREC_primary; 
    54735482    precedence[TOKfloat64] = PREC_primary; 
    54745483    precedence[TOKnull] = PREC_primary; 
    54755484    precedence[TOKstring] = PREC_primary; 
    54765485    precedence[TOKarrayliteral] = PREC_primary; 
    54775486    precedence[TOKtypeid] = PREC_primary; 
    54785487    precedence[TOKis] = PREC_primary; 
    54795488    precedence[TOKassert] = PREC_primary; 
    54805489    precedence[TOKfunction] = PREC_primary; 
    54815490    precedence[TOKvar] = PREC_primary; 
     5491    precedence[TOKsymoff] = PREC_primary; 
     5492    precedence[TOKstructliteral] = PREC_primary; 
    54825493#if DMDV2 
     5494    precedence[TOKtraits] = PREC_primary; 
    54835495    precedence[TOKdefault] = PREC_primary; 
    54845496#endif 
    54855497 
    54865498    // post 
    54875499    precedence[TOKdotti] = PREC_primary; 
    54885500    precedence[TOKdot] = PREC_primary; 
    54895501//  precedence[TOKarrow] = PREC_primary; 
    54905502    precedence[TOKplusplus] = PREC_primary; 
    54915503    precedence[TOKminusminus] = PREC_primary; 
    54925504    precedence[TOKcall] = PREC_primary; 
    54935505    precedence[TOKslice] = PREC_primary; 
    54945506    precedence[TOKarray] = PREC_primary; 
     5507    precedence[TOKindex] = PREC_primary; 
    54955508 
    54965509    precedence[TOKaddress] = PREC_unary; 
    54975510    precedence[TOKstar] = PREC_unary; 
    54985511    precedence[TOKneg] = PREC_unary; 
    54995512    precedence[TOKuadd] = PREC_unary; 
    55005513    precedence[TOKnot] = PREC_unary; 
    55015514    precedence[TOKtobool] = PREC_add; 
    55025515    precedence[TOKtilde] = PREC_unary; 
    55035516    precedence[TOKdelete] = PREC_unary; 
    55045517    precedence[TOKnew] = PREC_unary; 
    55055518    precedence[TOKcast] = PREC_unary; 
    55065519 
    55075520    precedence[TOKmul] = PREC_mul; 
    55085521    precedence[TOKdiv] = PREC_mul; 
    55095522    precedence[TOKmod] = PREC_mul; 
    55105523 
    55115524    precedence[TOKadd] = PREC_add; 
    55125525    precedence[TOKmin] = PREC_add; 
    55135526    precedence[TOKcat] = PREC_add; 
    55145527 
     
    55575570 
    55585571    precedence[TOKquestion] = PREC_cond; 
    55595572 
    55605573    precedence[TOKassign] = PREC_assign; 
    55615574    precedence[TOKconstruct] = PREC_assign; 
    55625575    precedence[TOKblit] = PREC_assign; 
    55635576    precedence[TOKaddass] = PREC_assign; 
    55645577    precedence[TOKminass] = PREC_assign; 
    55655578    precedence[TOKcatass] = PREC_assign; 
    55665579    precedence[TOKmulass] = PREC_assign; 
    55675580    precedence[TOKdivass] = PREC_assign; 
    55685581    precedence[TOKmodass] = PREC_assign; 
    55695582    precedence[TOKshlass] = PREC_assign; 
    55705583    precedence[TOKshrass] = PREC_assign; 
    55715584    precedence[TOKushrass] = PREC_assign; 
    55725585    precedence[TOKandass] = PREC_assign; 
    55735586    precedence[TOKorass] = PREC_assign; 
    55745587    precedence[TOKxorass] = PREC_assign; 
    55755588 
    55765589    precedence[TOKcomma] = PREC_expr; 
    5577 
    5578  
     5590    precedence[TOKdeclaration] = PREC_expr; 
     5591
     5592 
  • trunk/src/attrib.c

    r526 r629  
    307307 */ 
    308308 
    309309void AttribDeclaration::addLocalClass(ClassDeclarations *aclasses) 
    310310{ 
    311311    Dsymbols *d = include(NULL, NULL); 
    312312 
    313313    if (d) 
    314314    { 
    315315        for (unsigned i = 0; i < d->dim; i++) 
    316316        {   Dsymbol *s = (Dsymbol *)d->data[i]; 
    317317            s->addLocalClass(aclasses); 
    318318        } 
    319319    } 
    320320} 
    321321 
    322322 
    323323void AttribDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) 
    324324{ 
    325325    if (decl) 
    326326    { 
    327         buf->writenl(); 
    328         buf->writeByte('{'); 
    329         buf->writenl(); 
    330         for (unsigned i = 0; i < decl->dim; i++) 
    331         { 
    332             Dsymbol *s = (Dsymbol *)decl->data[i]; 
    333  
    334             buf->writestring("    "); 
    335             s->toCBuffer(buf, hgs); 
    336         } 
    337         buf->writeByte('}'); 
     327        if (decl->dim == 0) 
     328            buf->writestring("{}"); 
     329        else if (decl->dim == 1) 
     330            ((Dsymbol *)decl->data[0])->toCBuffer(buf, hgs); 
     331        else 
     332        { 
     333            buf->writenl(); 
     334            buf->writeByte('{'); 
     335            buf->writenl(); 
     336            for (unsigned i = 0; i < decl->dim; i++) 
     337            { 
     338                Dsymbol *s = (Dsymbol *)decl->data[i]; 
     339 
     340                buf->writestring("    "); 
     341                s->toCBuffer(buf, hgs); 
     342            } 
     343            buf->writeByte('}'); 
     344        } 
    338345    } 
    339346    else 
    340347        buf->writeByte(';'); 
    341348    buf->writenl(); 
    342349} 
    343350 
    344351/************************* StorageClassDeclaration ****************************/ 
    345352 
    346353StorageClassDeclaration::StorageClassDeclaration(StorageClass stc, Dsymbols *decl) 
    347354        : AttribDeclaration(decl) 
    348355{ 
    349356    this->stc = stc; 
    350357} 
    351358 
    352359Dsymbol *StorageClassDeclaration::syntaxCopy(Dsymbol *s) 
    353360{ 
    354361    StorageClassDeclaration *scd; 
    355362 
    356363    assert(!s); 
    357364    scd = new StorageClassDeclaration(stc, Dsymbol::arraySyntaxCopy(decl)); 
  • trunk/src/expression.c

    r616 r629  
    792792        assert(tret->isWild()); 
    793793        if (wildmatch & MODconst || wildmatch & (wildmatch - 1)) 
    794794            tret = tret->constOf(); 
    795795        else if (wildmatch & MODimmutable) 
    796796            tret = tret->invariantOf(); 
    797797        else 
    798798        {   assert(wildmatch & MODmutable); 
    799799            tret = tret->mutableOf(); 
    800800        } 
    801801    } 
    802802    return tret; 
    803803} 
    804804 
    805805/************************************************** 
    806806 * Write expression out to buf, but wrap it 
    807807 * in ( ) if its precedence is less than pr. 
    808808 */ 
    809809 
    810810void expToCBuffer(OutBuffer *buf, HdrGenState *hgs, Expression *e, enum PREC pr) 
    811811{ 
     812#ifdef DEBUG 
     813    if (precedence[e->op] == PREC_zero) 
     814        printf("precedence not defined for token '%s'\n",Token::tochars[e->op]); 
     815#endif 
     816    assert(precedence[e->op] != PREC_zero); 
     817    assert(pr != PREC_zero); 
     818 
    812819    //if (precedence[e->op] == 0) e->dump(0); 
    813820    if (precedence[e->op] < pr || 
    814821        /* Despite precedence, we don't allow a<b<c expressions. 
    815822         * They must be parenthesized. 
    816823         */ 
    817824        (pr == PREC_rel && precedence[e->op] == pr)) 
    818825    { 
    819826        buf->writeByte('('); 
    820827        e->toCBuffer(buf, hgs); 
    821828        buf->writeByte(')'); 
    822829    } 
    823830    else 
    824831        e->toCBuffer(buf, hgs); 
    825832} 
    826833 
    827834/************************************************** 
    828835 * Write out argument list to buf. 
    829836 */ 
    830837 
    831838void argsToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *hgs) 
     
    72437250#if DMDV2 
    72447251int CallExp::isLvalue() 
    72457252{ 
    72467253//    if (type->toBasetype()->ty == Tstruct) 
    72477254//      return 1; 
    72487255    Type *tb = e1->type->toBasetype(); 
    72497256    if (tb->ty == Tfunction && ((TypeFunction *)tb)->isref) 
    72507257        return 1;               // function returns a reference 
    72517258    return 0; 
    72527259} 
    72537260#endif 
    72547261 
    72557262Expression *CallExp::toLvalue(Scope *sc, Expression *e) 
    72567263{ 
    72577264    if (isLvalue()) 
    72587265        return this; 
    72597266    return Expression::toLvalue(sc, e); 
    72607267} 
    72617268 
    72627269void CallExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs) 
    7263 {   int i; 
    7264  
    7265     expToCBuffer(buf, hgs, e1, precedence[op]); 
     7270
     7271    if (e1->op == TOKtype) 
     7272        /* Avoid parens around type to prevent forbidden cast syntax: 
     7273         *   (sometype)(arg1) 
     7274         * This is ok since types in constructor calls 
     7275         * can never depend on parens anyway 
     7276         */ 
     7277        e1->toCBuffer(buf, hgs); 
     7278    else 
     7279        expToCBuffer(buf, hgs, e1, precedence[op]); 
    72667280    buf->writeByte('('); 
    72677281    argsToCBuffer(buf, arguments, hgs); 
    72687282    buf->writeByte(')'); 
    72697283} 
    72707284 
    72717285 
    72727286/************************************************************/ 
    72737287 
    72747288AddrExp::AddrExp(Loc loc, Expression *e) 
    72757289        : UnaExp(loc, TOKaddress, sizeof(AddrExp), e) 
    72767290{ 
    72777291} 
    72787292 
    72797293Expression *AddrExp::semantic(Scope *sc) 
    72807294{ 
    72817295#if LOGSEMANTIC 
    72827296    printf("AddrExp::semantic('%s')\n", toChars()); 
    72837297#endif 
    72847298    if (!type) 
    72857299    { 
  • trunk/src/parse.c

    r585 r629  
    62476247} 
    62486248 
    62496249/********************************************** 
    62506250 */ 
    62516251 
    62526252void Parser::addComment(Dsymbol *s, unsigned char *blockComment) 
    62536253{ 
    62546254    s->addComment(combineComments(blockComment, token.lineComment)); 
    62556255    token.lineComment = NULL; 
    62566256} 
    62576257 
    62586258 
    62596259/********************************** 
    62606260 * Set operator precedence for each operator. 
    62616261 */ 
    62626262 
    62636263enum PREC precedence[TOKMAX]; 
    62646264 
    62656265void initPrecedence() 
    62666266{ 
     6267    for (int i = 0; i < TOKMAX; i++) 
     6268        precedence[i] = PREC_zero; 
     6269 
     6270    precedence[TOKtype] = PREC_expr; 
     6271    precedence[TOKerror] = PREC_expr; 
     6272 
     6273    precedence[TOKtypeof] = PREC_primary; 
     6274    precedence[TOKmixin] = PREC_primary; 
     6275 
    62676276    precedence[TOKdotvar] = PREC_primary; 
    62686277    precedence[TOKimport] = PREC_primary; 
    62696278    precedence[TOKidentifier] = PREC_primary; 
    62706279    precedence[TOKthis] = PREC_primary; 
    62716280    precedence[TOKsuper] = PREC_primary; 
    62726281    precedence[TOKint64] = PREC_primary; 
    62736282    precedence[TOKfloat64] = PREC_primary; 
    62746283    precedence[TOKnull] = PREC_primary; 
    62756284    precedence[TOKstring] = PREC_primary; 
    62766285    precedence[TOKarrayliteral] = PREC_primary; 
    62776286    precedence[TOKtypeid] = PREC_primary; 
    62786287    precedence[TOKis] = PREC_primary; 
    62796288    precedence[TOKassert] = PREC_primary; 
    62806289    precedence[TOKfunction] = PREC_primary; 
    62816290    precedence[TOKvar] = PREC_primary; 
     6291    precedence[TOKsymoff] = PREC_primary; 
     6292    precedence[TOKstructliteral] = PREC_primary; 
    62826293#if DMDV2 
     6294    precedence[TOKtraits] = PREC_primary; 
    62836295    precedence[TOKdefault] = PREC_primary; 
    62846296#endif 
    62856297 
    62866298    // post 
    62876299    precedence[TOKdotti] = PREC_primary; 
    62886300    precedence[TOKdot] = PREC_primary; 
    62896301//  precedence[TOKarrow] = PREC_primary; 
    62906302    precedence[TOKplusplus] = PREC_primary; 
    62916303    precedence[TOKminusminus] = PREC_primary; 
    62926304    precedence[TOKpreplusplus] = PREC_primary; 
    62936305    precedence[TOKpreminusminus] = PREC_primary; 
    62946306    precedence[TOKcall] = PREC_primary; 
    62956307    precedence[TOKslice] = PREC_primary; 
    62966308    precedence[TOKarray] = PREC_primary; 
     6309    precedence[TOKindex] = PREC_primary; 
    62976310 
    62986311    precedence[TOKaddress] = PREC_unary; 
    62996312    precedence[TOKstar] = PREC_unary; 
    63006313    precedence[TOKneg] = PREC_unary; 
    63016314    precedence[TOKuadd] = PREC_unary; 
    63026315    precedence[TOKnot] = PREC_unary; 
    63036316    precedence[TOKtobool] = PREC_add; 
    63046317    precedence[TOKtilde] = PREC_unary; 
    63056318    precedence[TOKdelete] = PREC_unary; 
    63066319    precedence[TOKnew] = PREC_unary; 
    63076320    precedence[TOKcast] = PREC_unary; 
    63086321 
    63096322    precedence[TOKpow] = PREC_pow; 
    63106323 
    63116324    precedence[TOKmul] = PREC_mul; 
    63126325    precedence[TOKdiv] = PREC_mul; 
    63136326    precedence[TOKmod] = PREC_mul; 
    63146327    precedence[TOKpow] = PREC_mul; 
    63156328 
    63166329    precedence[TOKadd] = PREC_add; 
     
    63636376    precedence[TOKquestion] = PREC_cond; 
    63646377 
    63656378    precedence[TOKassign] = PREC_assign; 
    63666379    precedence[TOKconstruct] = PREC_assign; 
    63676380    precedence[TOKblit] = PREC_assign; 
    63686381    precedence[TOKaddass] = PREC_assign; 
    63696382    precedence[TOKminass] = PREC_assign; 
    63706383    precedence[TOKcatass] = PREC_assign; 
    63716384    precedence[TOKmulass] = PREC_assign; 
    63726385    precedence[TOKdivass] = PREC_assign; 
    63736386    precedence[TOKmodass] = PREC_assign; 
    63746387    precedence[TOKpowass] = PREC_assign; 
    63756388    precedence[TOKshlass] = PREC_assign; 
    63766389    precedence[TOKshrass] = PREC_assign; 
    63776390    precedence[TOKushrass] = PREC_assign; 
    63786391    precedence[TOKandass] = PREC_assign; 
    63796392    precedence[TOKorass] = PREC_assign; 
    63806393    precedence[TOKxorass] = PREC_assign; 
    63816394 
    63826395    precedence[TOKcomma] = PREC_expr; 
    6383 
    6384  
    6385  
     6396    precedence[TOKdeclaration] = PREC_expr; 
     6397
     6398 
     6399 
  • trunk/src/statement.c

    r586 r629  
    30913091    for (uinteger_t i = fval; i != lval + 1; i++) 
    30923092    { 
    30933093        Statement *s = statement; 
    30943094        if (i != lval)                          // if not last case 
    30953095            s = new ExpStatement(loc, NULL); 
    30963096        Expression *e = new IntegerExp(loc, i, first->type); 
    30973097        Statement *cs = new CaseStatement(loc, e, s); 
    30983098        statements->push(cs); 
    30993099    } 
    31003100    Statement *s = new CompoundStatement(loc, statements); 
    31013101    s = s->semantic(sc); 
    31023102    return s; 
    31033103} 
    31043104 
    31053105void CaseRangeStatement::toCBuffer(OutBuffer *buf, HdrGenState *hgs) 
    31063106{ 
    31073107    buf->writestring("case "); 
    31083108    first->toCBuffer(buf, hgs); 
    31093109    buf->writestring(": .. case "); 
    31103110    last->toCBuffer(buf, hgs); 
     3111    buf->writebyte(':'); 
    31113112    buf->writenl(); 
    31123113    statement->toCBuffer(buf, hgs); 
    31133114} 
    31143115 
    31153116#endif 
    31163117 
    31173118/******************************** DefaultStatement ***************************/ 
    31183119 
    31193120DefaultStatement::DefaultStatement(Loc loc, Statement *s) 
    31203121    : Statement(loc) 
    31213122{ 
    31223123    this->statement = s; 
    31233124#if IN_GCC 
    31243125+    cblock = NULL; 
    31253126#endif 
    31263127} 
    31273128 
    31283129Statement *DefaultStatement::syntaxCopy() 
    31293130{ 
    31303131    DefaultStatement *s = new DefaultStatement(loc, statement->syntaxCopy());