Changeset 459

Show
Ignore:
Timestamp:
04/12/07 03:10:35 (2 years ago)
Author:
Gregor
Message:

MERGE: dmdfe r458

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/rebuild/access.c

    r297 r459  
    33// All Rights Reserved 
    44// written by Walter Bright 
    5 // www.digitalmars.com 
     5// http://www.digitalmars.com 
    66// License for redistribution is by either the Artistic License 
    77// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/aggregate.h

    r446 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/arraytypes.h

    r363 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/attrib.c

    r416 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/attrib.h

    r317 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/cast.c

    r311 r459  
    33// All Rights Reserved 
    44// written by Walter Bright 
    5 // www.digitalmars.com 
     5// http://www.digitalmars.com 
    66// License for redistribution is by either the Artistic License 
    77// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    899899    Type *tb = t->toBasetype(); 
    900900    if ((tb->ty == Tarray || tb->ty == Tsarray) && 
    901     (typeb->ty == Tarray || typeb->ty == Tsarray)) 
     901    (typeb->ty == Tarray || typeb->ty == Tsarray) && 
     902    tb->next->toBasetype()->ty != Tvoid) 
    902903    { 
    903904    if (tb->ty == Tsarray) 
  • trunk/rebuild/class.c

    r446 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    395395    if (baseClass) 
    396396    { 
     397    if (baseClass->storage_class & STCfinal) 
     398        error("cannot inherit from final class %s", baseClass->toChars()); 
     399 
    397400    interfaces_dim--; 
    398401    interfaces++; 
     
    482485 
    483486    sc = sc->push(this); 
    484     sc->stc &= ~(STCauto | STCscope | STCstatic | STCabstract | STCdeprecated); 
     487    sc->stc &= ~(STCfinal | STCauto | STCscope | STCstatic | 
     488         STCabstract | STCdeprecated); 
    485489    sc->parent = this; 
    486490    sc->inunion = 0; 
  • trunk/rebuild/complex_t.h

    r272 r459  
    44// All Rights Reserved 
    55// written by Walter Bright and Burton Radons 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/cond.c

    r416 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/cond.h

    r272 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/constfold.c

    r416 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    10761076    } 
    10771077    } 
     1078    else if (e1->type->toBasetype()->ty == Tarray && e2->op == TOKint64) 
     1079    { 
     1080    uinteger_t i = e2->toInteger(); 
     1081 
     1082    if (e1->op == TOKarrayliteral && !e1->checkSideEffect(2)) 
     1083    {   ArrayLiteralExp *ale = (ArrayLiteralExp *)e1; 
     1084        if (i >= ale->elements->dim) 
     1085        {   e2->error("array index %ju is out of bounds %s[0 .. %u]", i, e1->toChars(), ale->elements->dim); 
     1086        } 
     1087        else 
     1088        {   e = (Expression *)ale->elements->data[i]; 
     1089        e->type = type; 
     1090        } 
     1091    } 
     1092    } 
    10781093    return e; 
    10791094} 
  • trunk/rebuild/declaration.c

    r446 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    138138        char *name = (char *)buf.extractData(); 
    139139        Identifier *id = new Identifier(name, TOKidentifier); 
    140         Argument *arg = new Argument(In, t, id, NULL); 
     140        Argument *arg = new Argument(STCin, t, id, NULL); 
    141141#else 
    142         Argument *arg = new Argument(In, t, NULL, NULL); 
     142        Argument *arg = new Argument(STCin, t, NULL, NULL); 
    143143#endif 
    144144        args->data[i] = (void *)arg; 
     
    373373 
    374374    Dsymbol *s; 
    375  
    376     if (type->ty == Tident) 
    377     { 
    378     TypeIdentifier *ti = (TypeIdentifier *)type; 
    379  
    380     s = ti->toDsymbol(sc); 
    381     if (s) 
    382         goto L2;            // it's a symbolic alias 
    383     } 
    384     else if (type->ty == Tinstance) 
    385     { 
    386     // Handle forms like: 
    387     //  alias instance TFoo(int).bar.abc def; 
    388  
    389     TypeInstance *ti = (TypeInstance *)type; 
    390  
    391     s = ti->tempinst; 
    392     if (s) 
    393     { 
    394         s->semantic(sc); 
    395         s = s->toAlias(); 
    396         if (sc->parent->isFuncDeclaration()) 
    397         s->semantic2(sc); 
    398  
    399         for (int i = 0; i < ti->idents.dim; i++) 
    400         {   Identifier *id; 
    401  
    402         id = (Identifier *)ti->idents.data[i]; 
    403         s = s->search(loc, id, 0); 
    404         if (!s)         // failed to find a symbol 
    405             goto L1;        // it must be a type 
    406         s = s->toAlias(); 
    407         } 
     375    Type *t; 
     376    Expression *e; 
     377 
     378    /* This section is needed because resolve() will: 
     379     *   const x = 3; 
     380     *   alias x y; 
     381     * try to alias y to 3. 
     382     */ 
     383    s = type->toDsymbol(sc); 
     384    if (s) 
     385    goto L2;            // it's a symbolic alias 
     386 
     387    //printf("alias type is %s\n", type->toChars()); 
     388    type->resolve(loc, sc, &e, &t, &s); 
     389    if (s) 
     390    { 
     391    goto L2; 
     392    } 
     393    else if (e) 
     394    { 
     395    // Try to convert Expression to Dsymbol 
     396        if (e->op == TOKvar) 
     397    {   s = ((VarExp *)e)->var; 
    408398        goto L2; 
    409399    } 
    410     } 
    411   L1: 
     400        else if (e->op == TOKfunction) 
     401    {   s = ((FuncExp *)e)->fd; 
     402        goto L2; 
     403    } 
     404        else 
     405    {   //error("cannot alias an expression %s", e->toChars()); 
     406        t = e->type; 
     407    } 
     408    } 
     409    else if (t) 
     410    type = t; 
    412411    if (overnext) 
    413412    ScopeDsymbol::multiplyDefined(0, this, overnext); 
    414     type = type->semantic(loc, sc); 
    415413    this->inSemantic = 0; 
    416414    return; 
    417415 
    418416  L2: 
     417    //printf("alias is a symbol %s %s\n", s->kind(), s->toChars()); 
    419418    type = NULL; 
    420419    VarDeclaration *v = s->isVarDeclaration(); 
     
    426425    else 
    427426    { 
    428     FuncDeclaration *f = s->isFuncDeclaration(); 
     427    FuncDeclaration *f = s->toAlias()->isFuncDeclaration(); 
    429428    if (f) 
    430429    { 
     
    480479Dsymbol *AliasDeclaration::toAlias() 
    481480{ 
    482     //printf("AliasDeclaration::toAlias('%s', this = %p, aliassym = %p, kind = '%s')\n", toChars(), this, aliassym, aliassym->kind()); 
     481    //printf("AliasDeclaration::toAlias('%s', this = %p, aliassym = %p, kind = '%s')\n", toChars(), this, aliassym, aliassym ? aliassym->kind() : ""); 
    483482    assert(this != aliassym); 
    484483    //static int count; if (++count == 10) *(char*)0=0; 
     
    549548    aliassym = NULL; 
    550549    onstack = 0; 
     550    canassign = 0; 
    551551    value = NULL; 
    552552} 
     
    692692    storage_class = (storage_class & ~STCconst) | STCctorinit; 
    693693 
    694     if (isConst()
     694    if (isConst() || isFinal()
    695695    { 
    696696    } 
     
    752752    if (type->isauto() && !noauto) 
    753753    { 
    754     if (storage_class & (STCfield | STCout | STCstatic) || !fd) 
    755     { 
    756         //error("globals, statics, fields, inout and out parameters cannot be auto"); 
    757     } 
     754    /* if (storage_class & (STCfield | STCout | STCref | STCstatic) || !fd) 
     755    { 
     756        error("globals, statics, fields, ref and out parameters cannot be auto"); 
     757    } */ 
    758758 
    759759    if (!(storage_class & (STCauto | STCscope))) 
     
    869869        } 
    870870        ei->exp = new AssignExp(loc, e1, ei->exp); 
     871        ei->exp->op = TOKconstruct; 
     872        canassign++; 
    871873        ei->exp = ei->exp->semantic(sc); 
     874        canassign--; 
    872875        ei->exp->optimize(WANTvalue); 
    873876        } 
     
    881884        } 
    882885    } 
    883     else if (isConst()
     886    else if (isConst() || isFinal()
    884887    { 
    885888        /* Because we may need the results of a const declaration in a 
  • trunk/rebuild/declaration.h

    r416 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    6161    STCtemplateparameter = 0x40000, // template parameter 
    6262    STCscope        = 0x80000,      // template parameter 
     63    STCinvariant    = 0x100000, 
     64    STCref      = 0x200000, 
    6365}; 
    6466 
     
    111113    int isIn()    { return storage_class & STCin; } 
    112114    int isOut()   { return storage_class & STCout; } 
    113     int isInOut() { return (storage_class & (STCin | STCout)) == (STCin | STCout); } 
     115    int isRef()   { return storage_class & STCref; } 
    114116 
    115117    enum PROT prot(); 
     
    209211    int onstack;        // 1: it has been allocated on the stack 
    210212                // 2: on stack, run destructor anyway 
     213    int canassign;      // it can be assigned to 
    211214    Dsymbol *aliassym;      // if redone as alias to another symbol 
    212215    Expression *value;      // when interpreting, this is the value 
  • trunk/rebuild/delegatize.c

    r272 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/doc.c

    r446 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/doc.h

    r272 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/dsymbol.c

    r446 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    2828#include "init.h" 
    2929#include "import.h" 
     30#include "template.h" 
    3031 
    3132/****************************** Dsymbol ******************************/ 
     
    264265    //printf("Dsymbol::search(this=%p,%s, ident='%s')\n", this, toChars(), ident->toChars()); 
    265266    return NULL; 
    266 //    error("%s.%s is undefined",toChars(), ident->toChars()); 
    267 //    return this; 
     267
     268 
     269/*************************************** 
     270 * Search for identifier id as a member of 'this'. 
     271 * id may be a template instance. 
     272 * Returns: 
     273 *  symbol found, NULL if not 
     274 */ 
     275 
     276Dsymbol *Dsymbol::searchX(Loc loc, Scope *sc, Identifier *id) 
     277
     278    //printf("Dsymbol::searchX(this=%p,%s, ident='%s')\n", this, toChars(), ident->toChars()); 
     279    Dsymbol *s = toAlias(); 
     280    Dsymbol *sm; 
     281 
     282    switch (id->dyncast()) 
     283    { 
     284    case DYNCAST_IDENTIFIER: 
     285        sm = s->search(loc, id, 0); 
     286        break; 
     287 
     288    case DYNCAST_DSYMBOL: 
     289    {   // It's a template instance 
     290        //printf("\ttemplate instance id\n"); 
     291        Dsymbol *st = (Dsymbol *)id; 
     292        TemplateInstance *ti = st->isTemplateInstance(); 
     293        id = ti->name; 
     294        sm = s->search(loc, id, 0); 
     295        if (!sm) 
     296        {   error("template identifier %s is not a member of %s %s", 
     297            id->toChars(), s->kind(), s->toChars()); 
     298        return NULL; 
     299        } 
     300        sm = sm->toAlias(); 
     301        TemplateDeclaration *td = sm->isTemplateDeclaration(); 
     302        if (!td) 
     303        { 
     304        error("%s is not a template, it is a %s", id->toChars(), sm->kind()); 
     305        return NULL; 
     306        } 
     307        ti->tempdecl = td; 
     308        if (!ti->semanticdone) 
     309        ti->semantic(sc); 
     310        sm = ti->toAlias(); 
     311        break; 
     312    } 
     313 
     314    default: 
     315        assert(0); 
     316    } 
     317    return sm; 
    268318} 
    269319 
     
    680730    else 
    681731    { 
    682     s1->error(loc, "conflicts with %s at %s", 
     732    s1->error(loc, "conflicts with %s %s at %s", 
     733        s2->kind(), 
    683734        s2->toPrettyChars(), 
    684735        s2->locToChars()); 
    685736    } */ 
    686 //*(char*)0=0; 
    687737} 
    688738 
  • trunk/rebuild/dsymbol.h

    r311 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    124124    virtual void inlineScan(); 
    125125    virtual Dsymbol *search(Loc loc, Identifier *ident, int flags); 
     126    Dsymbol *searchX(Loc loc, Scope *sc, Identifier *id); 
    126127    virtual int overloadInsert(Dsymbol *s); 
    127128#ifdef _DH 
  • trunk/rebuild/dump.c

    r272 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/entity.c

    r297 r459  
    33// All Rights Reserved 
    44// written by Walter Bright 
    5 // www.digitalmars.com 
     5// http://www.digitalmars.com 
    66// License for redistribution is by either the Artistic License 
    77// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/enum.c

    r272 r459  
    33// All Rights Reserved 
    44// written by Walter Bright 
    5 // www.digitalmars.com 
     5// http://www.digitalmars.com 
    66// License for redistribution is by either the Artistic License 
    77// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/enum.h

    r272 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/expression.c

    r446 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    499499 
    500500    L1: 
    501         if (!(p->inout == Lazy && p->type->ty == Tvoid)) 
     501        if (!(p->storageClass & STClazy && p->type->ty == Tvoid)) 
    502502        arg = arg->implicitCastTo(sc, p->type); 
    503         if (p->inout == Out || p->inout == InOut
     503        if (p->storageClass & (STCout | STCref)
    504504        { 
    505         // BUG: should check that argument to inout is type 'invariant' 
    506         // BUG: assignments to inout should also be type 'invariant' 
     505        // BUG: should check that argument to ref is type 'invariant' 
     506        // BUG: assignments to ref should also be type 'invariant' 
    507507        arg = arg->modifiableLvalue(sc, NULL); 
    508508 
    509509        //if (arg->op == TOKslice) 
    510510            //arg->error("cannot modify slice %s", arg->toChars()); 
    511  
    512         // Don't have a way yet to do a pointer to a bit in array 
    513         /*if (arg->op == TOKarray && 
    514             arg->type->toBasetype()->ty == Tbit) 
    515             error("cannot have out or inout argument of bit in array"); */ 
    516511        } 
    517512 
     
    524519 
    525520        // Convert lazy argument to a delegate 
    526         if (p->inout == Lazy) 
     521        if (p->storageClass & STClazy) 
    527522        { 
    528523        arg = arg->toDelegate(sc, p->type); 
     
    16191614        if (ti && 
    16201615            !ti->isTemplateMixin() && 
    1621             (ti->idents.data[ti->idents.dim - 1] == f->ident || 
     1616            (ti->name == f->ident || 
    16221617             ti->toAlias()->ident == f->ident) 
    16231618            && 
     
    23982393        { 
    23992394                p = utf_decodeWchar((unsigned short *)string, len, &u, &c); 
    2400                 if (p) 
    2401                     error("%s", p); 
     2395                if (p) 0; 
     2396                    //error("%s", p); 
    24022397                else 
    24032398                    tmp.writeUTF8(c); 
     
    24112406            { 
    24122407                c = ((unsigned *)string)[u]; 
    2413                 if (!utf_isValidDchar(c)) 
    2414                     error("invalid UCS-32 char \\U%08x", c); 
     2408                if (!utf_isValidDchar(c)) 0; 
     2409                    //error("invalid UCS-32 char \\U%08x", c); 
    24152410                else 
    24162411                    tmp.writeUTF8(c); 
     
    28252820        error("e.new is only for allocating nested classes"); */ 
    28262821    } 
    2827     else if (thisexp) 
    2828         error("e.new is only for allocating nested classes"); 
     2822    /* else if (thisexp) 
     2823        error("e.new is only for allocating nested classes"); */ 
    28292824 
    28302825    FuncDeclaration *f = cd->ctor; 
     
    31993194        synerr(EM_lvalue);  // lvalue expected 
    32003195#endif 
    3201     /*if (var->storage_class & STClazy) 
     3196    /* if (var->storage_class & STClazy) 
    32023197    error("lazy variables cannot be lvalues"); */ 
    32033198    return this; 
     
    32073202{ 
    32083203    //printf("VarExp::modifiableLvalue('%s')\n", var->toChars()); 
    3209     /*if (sc->incontract && var->isParameter()) 
     3204    /* if (sc->incontract && var->isParameter()) 
    32103205    error("cannot modify parameter '%s' in contract", var->toChars()); 
    32113206 
    32123207    if (type && type->toBasetype()->ty == Tsarray) 
    3213     error("cannot change reference to static array '%s'", var->toChars()); 
    3214  
    3215     if (var->isConst()) 
    3216     error("cannot modify const variable '%s'", var->toChars()); */ 
     3208    error("cannot change reference to static array '%s'", var->toChars()); */ 
     3209 
     3210    VarDeclaration *v = var->isVarDeclaration(); 
     3211    /* if (v && v->canassign == 0 && (var->isConst() || var->isFinal())) 
     3212    error("cannot modify final variable '%s'", var->toChars()); */ 
    32173213 
    32183214    if (var->isCtorinit()) 
     
    37053701            for (size_t i = 0; i < cd->baseclasses.dim; i++) 
    37063702            {   BaseClass *b = (BaseClass *)cd->baseclasses.data[i]; 
    3707             args->push(new Argument(In, b->type, NULL, NULL)); 
     3703            args->push(new Argument(STCin, b->type, NULL, NULL)); 
    37083704            } 
    37093705            tded = new TypeTuple(args); 
     
    37383734        {   Argument *arg = Argument::getNth(params, i); 
    37393735            assert(arg && arg->type); 
    3740             args->push(new Argument(arg->inout, arg->type, NULL, NULL)); 
     3736            args->push(new Argument(arg->storageClass, arg->type, NULL, NULL)); 
    37413737        } 
    37423738        tded = new TypeTuple(args); 
     
    40484044Expression *CompileExp::semantic(Scope *sc) 
    40494045{ 
    4050 #if LOGSEMANTIC 
     4046#if 1 || LOGSEMANTIC 
    40514047    printf("CompileExp::semantic('%s')\n", toChars()); 
    40524048#endif 
     
    40544050    e1 = resolveProperties(sc, e1); 
    40554051    e1 = e1->optimize(WANTvalue | WANTinterpret); 
     4052e1->print(); 
    40564053    if (e1->op != TOKstring) 
    4057     {   error("argument to mixin must be a string, not (%s)", e1->toChars()); 
     4054    {   //error("argument to mixin must be a string, not (%s)", e1->toChars()); 
    40584055    return this; 
    40594056    } 
     
    40634060    p.loc = loc; 
    40644061    Expression *e = p.parseExpression(); 
    4065     if (p.token.value != TOKeof) 
    4066     error("incomplete mixin expression (%s)", se->toChars()); 
     4062    /* if (p.token.value != TOKeof) 
     4063    error("incomplete mixin expression (%s)", se->toChars()); */ 
    40674064    return e->semantic(sc); 
    40684065} 
     
    40934090    e1 = e1->optimize(WANTvalue); 
    40944091    if (e1->op != TOKstring) 
    4095     {   error("file name argument must be a string, not (%s)", e1->toChars()); 
     4092    {   //error("file name argument must be a string, not (%s)", e1->toChars()); 
    40964093    goto Lerror; 
    40974094    } 
     
    41014098 
    41024099    if (!global.params.fileImppath) 
    4103     {   error("need -Jpath switch to import text file %s", name); 
     4100    {   //error("need -Jpath switch to import text file %s", name); 
    41044101    goto Lerror; 
    41054102    } 
    41064103 
    41074104    if (name != FileName::name(name)) 
    4108     {   error("use -Jpath switch to provide path for filename %s", name); 
     4105    {   //error("use -Jpath switch to provide path for filename %s", name); 
    41094106    goto Lerror; 
    41104107    } 
     
    41124109    name = FileName::searchPath(global.filePath, name, 0); 
    41134110    if (!name) 
    4114     {   error("file %s cannot be found, check -Jpath", se->toChars()); 
     4111    {   //error("file %s cannot be found, check -Jpath", se->toChars()); 
    41154112    goto Lerror; 
    41164113    } 
     
    41214118    {   File f(name); 
    41224119    if (f.read()) 
    4123     {   error("cannot read file %s", f.toChars()); 
     4120    {   //error("cannot read file %s", f.toChars()); 
    41244121        goto Lerror; 
    41254122    } 
     
    47364733 
    47374734    assert(s); 
    4738     id = (Identifier *)ti->idents.data[0]
     4735    id = ti->name
    47394736    s2 = s->search(loc, id, 0); 
    47404737    if (!s2) 
     
    53025299 
    53035300        if (ti && 
    5304         (ti->idents.data[ti->idents.dim - 1] == f->ident || 
     5301        (ti->name == f->ident || 
    53055302         ti->toAlias()->ident == f->ident) 
    53065303        && 
     
    58195816    if (v) 
    58205817    { 
    5821         if (!v->isDataseg()) 
    5822         error("escaping reference to local %s", v->toChars()); 
     5818        /* if (!v->isDataseg()) 
     5819        error("escaping reference to local %s", v->toChars()); */ 
    58235820    } 
    58245821    } 
     
    73197316{   Expression *e; 
    73207317 
     7318#if 0 
     7319    printf("MulExp::semantic() %s\n", toChars()); 
     7320#endif 
    73217321    if (type) 
     7322    { 
    73227323    return this; 
     7324    } 
    73237325 
    73247326    BinExp::semanticp(sc); 
  • trunk/rebuild/expression.h

    r446 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
  • trunk/rebuild/func.c

    r446 r459  
    44// All Rights Reserved 
    55// written by Walter Bright 
    6 // www.digitalmars.com 
     6// http://www.digitalmars.com 
    77// License for redistribution is by either the Artistic License 
    88// in artistic.txt, or the GNU General Public License in gnu.txt. 
     
    479479            arg0->type->next->ty != Tarray || 
    480480            arg0->type->next->next->ty != Tchar || 
    481             (arg0->inout != None && arg0->inout != In)) 
     481            arg0->storageClass & (STCout | STCref | STClazy)) 
    482482            goto Lmainerr; 
    483483        break; 
     
    696696            for (size_t j = 0; j < dim; j++) 
    697697            {   Argument *narg = Argument::getNth(t->arguments, j); 
    698             narg->inout = arg->inout
     698            narg->storageClass = arg->storageClass
    699699            } 
    700700        } 
     
    726726        if (f->varargs == 2 && i + 1 == nparams) 
    727727            v->storage_class |= STCvariadic; 
    728         switch (arg->inout) 
    729         {   case In:    v->storage_class |= STCin;      break; 
    730             case Out:   v->storage_class |= STCout;     break; 
    731             case InOut: v->storage_class |= STCin | STCout; break; 
    732             case Lazy:  v->storage_class |= STCin | STClazy; break; 
    733             default: assert(0); 
    734         } 
     728        v->storage_class |= arg->storageClass & (STCin | STCout | STCref | STClazy); 
     729        if (v->storage_class & STClazy) 
     730            v->storage_class |= STCin; 
    735731        v->semantic(sc2); 
    736732        if (!sc2->insert(v)) {} 
     
    784780        // BUG: need to treat parameters as const 
    785781        // BUG: need to disallow returns and throws 
    786         // BUG: verify that all in and inout parameters are read 
     782        // BUG: verify that all in and ref parameters are read 
    787783        frequire = frequire->semantic(sc2); 
    788784        labtab = NULL;      // so body can't refer to labels 
     
    10321028 
    10331029            v = (VarDeclaration *)parameters->data[i]; 
    1034             if ((v->storage_class & (STCout | STCin)) == STCout) 
     1030            if (v->storage_class & STCout) 
    10351031            { 
    10361032            assert(v->init); 
  • trunk/rebuild/hdrgen.c