Changeset 458
- Timestamp:
- 04/12/07 02:54:56 (1 year ago)
- Files:
-
- branches/dmdfe/access.c (modified) (1 diff)
- branches/dmdfe/aggregate.h (modified) (1 diff)
- branches/dmdfe/arraytypes.h (modified) (1 diff)
- branches/dmdfe/attrib.c (modified) (1 diff)
- branches/dmdfe/attrib.h (modified) (1 diff)
- branches/dmdfe/bit.c (modified) (1 diff)
- branches/dmdfe/cast.c (modified) (2 diffs)
- branches/dmdfe/class.c (modified) (3 diffs)
- branches/dmdfe/complex_t.h (modified) (1 diff)
- branches/dmdfe/cond.c (modified) (1 diff)
- branches/dmdfe/cond.h (modified) (1 diff)
- branches/dmdfe/constfold.c (modified) (2 diffs)
- branches/dmdfe/declaration.c (modified) (10 diffs)
- branches/dmdfe/declaration.h (modified) (4 diffs)
- branches/dmdfe/delegatize.c (modified) (1 diff)
- branches/dmdfe/doc.c (modified) (1 diff)
- branches/dmdfe/doc.h (modified) (1 diff)
- branches/dmdfe/dsymbol.c (modified) (4 diffs)
- branches/dmdfe/dsymbol.h (modified) (2 diffs)
- branches/dmdfe/dump.c (modified) (1 diff)
- branches/dmdfe/entity.c (modified) (1 diff)
- branches/dmdfe/enum.c (modified) (1 diff)
- branches/dmdfe/enum.h (modified) (1 diff)
- branches/dmdfe/expression.c (modified) (12 diffs)
- branches/dmdfe/expression.h (modified) (1 diff)
- branches/dmdfe/func.c (modified) (6 diffs)
- branches/dmdfe/hdrgen.c (modified) (1 diff)
- branches/dmdfe/hdrgen.h (modified) (1 diff)
- branches/dmdfe/html.c (modified) (1 diff)
- branches/dmdfe/html.h (modified) (1 diff)
- branches/dmdfe/identifier.c (modified) (1 diff)
- branches/dmdfe/identifier.h (modified) (1 diff)
- branches/dmdfe/idgen.c (modified) (1 diff)
- branches/dmdfe/impcnvgen.c (modified) (1 diff)
- branches/dmdfe/import.c (modified) (1 diff)
- branches/dmdfe/import.h (modified) (1 diff)
- branches/dmdfe/inifile.c (modified) (1 diff)
- branches/dmdfe/init.c (modified) (3 diffs)
- branches/dmdfe/init.h (modified) (1 diff)
- branches/dmdfe/inline.c (modified) (3 diffs)
- branches/dmdfe/interpret.c (modified) (18 diffs)
- branches/dmdfe/lexer.c (modified) (3 diffs)
- branches/dmdfe/lexer.h (modified) (2 diffs)
- branches/dmdfe/link.c (modified) (1 diff)
- branches/dmdfe/macro.c (modified) (1 diff)
- branches/dmdfe/macro.h (modified) (1 diff)
- branches/dmdfe/mangle.c (modified) (1 diff)
- branches/dmdfe/mars.c (modified) (3 diffs)
- branches/dmdfe/mars.h (modified) (1 diff)
- branches/dmdfe/module.c (modified) (1 diff)
- branches/dmdfe/module.h (modified) (1 diff)
- branches/dmdfe/mtype.c (modified) (24 diffs)
- branches/dmdfe/mtype.h (modified) (2 diffs)
- branches/dmdfe/opover.c (modified) (2 diffs)
- branches/dmdfe/optimize.c (modified) (3 diffs)
- branches/dmdfe/parse.c (modified) (22 diffs)
- branches/dmdfe/parse.h (modified) (3 diffs)
- branches/dmdfe/scope.c (modified) (3 diffs)
- branches/dmdfe/scope.h (modified) (2 diffs)
- branches/dmdfe/statement.c (modified) (13 diffs)
- branches/dmdfe/statement.h (modified) (1 diff)
- branches/dmdfe/staticassert.c (modified) (1 diff)
- branches/dmdfe/staticassert.h (modified) (1 diff)
- branches/dmdfe/struct.c (modified) (3 diffs)
- branches/dmdfe/template.c (modified) (29 diffs)
- branches/dmdfe/template.h (modified) (5 diffs)
- branches/dmdfe/tocsym.c (modified) (2 diffs)
- branches/dmdfe/todt.c (modified) (1 diff)
- branches/dmdfe/toir.c (modified) (1 diff)
- branches/dmdfe/toir.h (modified) (1 diff)
- branches/dmdfe/toobj.c (modified) (1 diff)
- branches/dmdfe/total.h (modified) (1 diff)
- branches/dmdfe/typinf.c (modified) (3 diffs)
- branches/dmdfe/unialpha.c (modified) (1 diff)
- branches/dmdfe/utf.c (modified) (1 diff)
- branches/dmdfe/utf.h (modified) (1 diff)
- branches/dmdfe/version.c (modified) (1 diff)
- branches/dmdfe/version.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dmdfe/access.c
r360 r458 3 3 // All Rights Reserved 4 4 // written by Walter Bright 5 // www.digitalmars.com5 // http://www.digitalmars.com 6 6 // License for redistribution is by either the Artistic License 7 7 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/aggregate.h
r445 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/arraytypes.h
r361 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/attrib.c
r414 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/attrib.h
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/bit.c
r360 r458 3 3 // All Rights Reserved 4 4 // written by Walter Bright 5 // www.digitalmars.com5 // http://www.digitalmars.com 6 6 // License for redistribution is by either the Artistic License 7 7 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/cast.c
r360 r458 3 3 // All Rights Reserved 4 4 // written by Walter Bright 5 // www.digitalmars.com5 // http://www.digitalmars.com 6 6 // License for redistribution is by either the Artistic License 7 7 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 899 899 Type *tb = t->toBasetype(); 900 900 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) 902 903 { 903 904 if (tb->ty == Tsarray) branches/dmdfe/class.c
r445 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 395 395 if (baseClass) 396 396 { 397 if (baseClass->storage_class & STCfinal) 398 error("cannot inherit from final class %s", baseClass->toChars()); 399 397 400 interfaces_dim--; 398 401 interfaces++; … … 482 485 483 486 sc = sc->push(this); 484 sc->stc &= ~(STCauto | STCscope | STCstatic | STCabstract | STCdeprecated); 487 sc->stc &= ~(STCfinal | STCauto | STCscope | STCstatic | 488 STCabstract | STCdeprecated); 485 489 sc->parent = this; 486 490 sc->inunion = 0; branches/dmdfe/complex_t.h
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright and Burton Radons 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/cond.c
r414 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/cond.h
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/constfold.c
r415 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 1076 1076 } 1077 1077 } 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 } 1078 1093 return e; 1079 1094 } branches/dmdfe/declaration.c
r445 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 138 138 char *name = (char *)buf.extractData(); 139 139 Identifier *id = new Identifier(name, TOKidentifier); 140 Argument *arg = new Argument( In, t, id, NULL);140 Argument *arg = new Argument(STCin, t, id, NULL); 141 141 #else 142 Argument *arg = new Argument( In, t, NULL, NULL);142 Argument *arg = new Argument(STCin, t, NULL, NULL); 143 143 #endif 144 144 args->data[i] = (void *)arg; … … 373 373 374 374 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; 408 398 goto L2; 409 399 } 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; 412 411 if (overnext) 413 412 ScopeDsymbol::multiplyDefined(0, this, overnext); 414 type = type->semantic(loc, sc);415 413 this->inSemantic = 0; 416 414 return; 417 415 418 416 L2: 417 //printf("alias is a symbol %s %s\n", s->kind(), s->toChars()); 419 418 type = NULL; 420 419 VarDeclaration *v = s->isVarDeclaration(); … … 426 425 else 427 426 { 428 FuncDeclaration *f = s-> isFuncDeclaration();427 FuncDeclaration *f = s->toAlias()->isFuncDeclaration(); 429 428 if (f) 430 429 { … … 480 479 Dsymbol *AliasDeclaration::toAlias() 481 480 { 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() : ""); 483 482 assert(this != aliassym); 484 483 //static int count; if (++count == 10) *(char*)0=0; … … 549 548 aliassym = NULL; 550 549 onstack = 0; 550 canassign = 0; 551 551 value = NULL; 552 552 } … … 692 692 storage_class = (storage_class & ~STCconst) | STCctorinit; 693 693 694 if (isConst() )694 if (isConst() || isFinal()) 695 695 { 696 696 } … … 752 752 if (type->isauto() && !noauto) 753 753 { 754 if (storage_class & (STCfield | STCout | STC static) || !fd)755 { 756 error("globals, statics, fields, inoutand out parameters cannot be auto");754 if (storage_class & (STCfield | STCout | STCref | STCstatic) || !fd) 755 { 756 error("globals, statics, fields, ref and out parameters cannot be auto"); 757 757 } 758 758 … … 869 869 } 870 870 ei->exp = new AssignExp(loc, e1, ei->exp); 871 ei->exp->op = TOKconstruct; 872 canassign++; 871 873 ei->exp = ei->exp->semantic(sc); 874 canassign--; 872 875 ei->exp->optimize(WANTvalue); 873 876 } … … 881 884 } 882 885 } 883 else if (isConst() )886 else if (isConst() || isFinal()) 884 887 { 885 888 /* Because we may need the results of a const declaration in a branches/dmdfe/declaration.h
r415 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 61 61 STCtemplateparameter = 0x40000, // template parameter 62 62 STCscope = 0x80000, // template parameter 63 STCinvariant = 0x100000, 64 STCref = 0x200000, 63 65 }; 64 66 … … 111 113 int isIn() { return storage_class & STCin; } 112 114 int isOut() { return storage_class & STCout; } 113 int is InOut() { return (storage_class & (STCin | STCout)) == (STCin | STCout); }115 int isRef() { return storage_class & STCref; } 114 116 115 117 enum PROT prot(); … … 209 211 int onstack; // 1: it has been allocated on the stack 210 212 // 2: on stack, run destructor anyway 213 int canassign; // it can be assigned to 211 214 Dsymbol *aliassym; // if redone as alias to another symbol 212 215 Expression *value; // when interpreting, this is the value branches/dmdfe/delegatize.c
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/doc.c
r445 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/doc.h
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/dsymbol.c
r445 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 28 28 #include "init.h" 29 29 #include "import.h" 30 #include "template.h" 30 31 31 32 /****************************** Dsymbol ******************************/ … … 264 265 //printf("Dsymbol::search(this=%p,%s, ident='%s')\n", this, toChars(), ident->toChars()); 265 266 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 276 Dsymbol *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; 268 318 } 269 319 … … 680 730 else 681 731 { 682 s1->error(loc, "conflicts with %s at %s", 732 s1->error(loc, "conflicts with %s %s at %s", 733 s2->kind(), 683 734 s2->toPrettyChars(), 684 735 s2->locToChars()); 685 736 } 686 //*(char*)0=0;687 737 } 688 738 branches/dmdfe/dsymbol.h
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 124 124 virtual void inlineScan(); 125 125 virtual Dsymbol *search(Loc loc, Identifier *ident, int flags); 126 Dsymbol *searchX(Loc loc, Scope *sc, Identifier *id); 126 127 virtual int overloadInsert(Dsymbol *s); 127 128 #ifdef _DH branches/dmdfe/dump.c
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/entity.c
r360 r458 3 3 // All Rights Reserved 4 4 // written by Walter Bright 5 // www.digitalmars.com5 // http://www.digitalmars.com 6 6 // License for redistribution is by either the Artistic License 7 7 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/enum.c
r360 r458 3 3 // All Rights Reserved 4 4 // written by Walter Bright 5 // www.digitalmars.com5 // http://www.digitalmars.com 6 6 // License for redistribution is by either the Artistic License 7 7 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/enum.h
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/expression.c
r445 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 499 499 500 500 L1: 501 if (!(p-> inout == Lazy && p->type->ty == Tvoid))501 if (!(p->storageClass & STClazy && p->type->ty == Tvoid)) 502 502 arg = arg->implicitCastTo(sc, p->type); 503 if (p-> inout == Out || p->inout == InOut)503 if (p->storageClass & (STCout | STCref)) 504 504 { 505 // BUG: should check that argument to inoutis type 'invariant'506 // BUG: assignments to inoutshould 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' 507 507 arg = arg->modifiableLvalue(sc, NULL); 508 508 509 509 //if (arg->op == TOKslice) 510 510 //arg->error("cannot modify slice %s", arg->toChars()); 511 512 // Don't have a way yet to do a pointer to a bit in array513 if (arg->op == TOKarray &&514 arg->type->toBasetype()->ty == Tbit)515 error("cannot have out or inout argument of bit in array");516 511 } 517 512 … … 524 519 525 520 // Convert lazy argument to a delegate 526 if (p-> inout == Lazy)521 if (p->storageClass & STClazy) 527 522 { 528 523 arg = arg->toDelegate(sc, p->type); … … 1618 1613 if (ti && 1619 1614 !ti->isTemplateMixin() && 1620 (ti-> idents.data[ti->idents.dim - 1]== f->ident ||1615 (ti->name == f->ident || 1621 1616 ti->toAlias()->ident == f->ident) 1622 1617 && … … 3212 3207 error("cannot change reference to static array '%s'", var->toChars()); 3213 3208 3214 if (var->isConst()) 3215 error("cannot modify const variable '%s'", var->toChars()); 3209 VarDeclaration *v = var->isVarDeclaration(); 3210 if (v && v->canassign == 0 && (var->isConst() || var->isFinal())) 3211 error("cannot modify final variable '%s'", var->toChars()); 3216 3212 3217 3213 if (var->isCtorinit()) … … 3704 3700 for (size_t i = 0; i < cd->baseclasses.dim; i++) 3705 3701 { BaseClass *b = (BaseClass *)cd->baseclasses.data[i]; 3706 args->push(new Argument( In, b->type, NULL, NULL));3702 args->push(new Argument(STCin, b->type, NULL, NULL)); 3707 3703 } 3708 3704 tded = new TypeTuple(args); … … 3737 3733 { Argument *arg = Argument::getNth(params, i); 3738 3734 assert(arg && arg->type); 3739 args->push(new Argument(arg-> inout, arg->type, NULL, NULL));3735 args->push(new Argument(arg->storageClass, arg->type, NULL, NULL)); 3740 3736 } 3741 3737 tded = new TypeTuple(args); … … 4047 4043 Expression *CompileExp::semantic(Scope *sc) 4048 4044 { 4049 #if LOGSEMANTIC4045 #if 1 || LOGSEMANTIC 4050 4046 printf("CompileExp::semantic('%s')\n", toChars()); 4051 4047 #endif … … 4053 4049 e1 = resolveProperties(sc, e1); 4054 4050 e1 = e1->optimize(WANTvalue | WANTinterpret); 4051 e1->print(); 4055 4052 if (e1->op != TOKstring) 4056 4053 { error("argument to mixin must be a string, not (%s)", e1->toChars()); … … 4735 4732 4736 4733 assert(s); 4737 id = (Identifier *)ti->idents.data[0];4734 id = ti->name; 4738 4735 s2 = s->search(loc, id, 0); 4739 4736 if (!s2) … … 5301 5298 5302 5299 if (ti && 5303 (ti-> idents.data[ti->idents.dim - 1]== f->ident ||5300 (ti->name == f->ident || 5304 5301 ti->toAlias()->ident == f->ident) 5305 5302 && … … 7318 7315 { Expression *e; 7319 7316 7317 #if 0 7318 printf("MulExp::semantic() %s\n", toChars()); 7319 #endif 7320 7320 if (type) 7321 { 7321 7322 return this; 7323 } 7322 7324 7323 7325 BinExp::semanticp(sc); branches/dmdfe/expression.h
r445 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/func.c
r445 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. … … 479 479 arg0->type->next->ty != Tarray || 480 480 arg0->type->next->next->ty != Tchar || 481 (arg0->inout != None && arg0->inout != In))481 arg0->storageClass & (STCout | STCref | STClazy)) 482 482 goto Lmainerr; 483 483 break; … … 694 694 for (size_t j = 0; j < dim; j++) 695 695 { Argument *narg = Argument::getNth(t->arguments, j); 696 narg-> inout = arg->inout;696 narg->storageClass = arg->storageClass; 697 697 } 698 698 } … … 724 724 if (f->varargs == 2 && i + 1 == nparams) 725 725 v->storage_class |= STCvariadic; 726 switch (arg->inout) 727 { case In: v->storage_class |= STCin; break; 728 case Out: v->storage_class |= STCout; break; 729 case InOut: v->storage_class |= STCin | STCout; break; 730 case Lazy: v->storage_class |= STCin | STClazy; break; 731 default: assert(0); 732 } 726 v->storage_class |= arg->storageClass & (STCin | STCout | STCref | STClazy); 727 if (v->storage_class & STClazy) 728 v->storage_class |= STCin; 733 729 v->semantic(sc2); 734 730 if (!sc2->insert(v)) … … 782 778 // BUG: need to treat parameters as const 783 779 // BUG: need to disallow returns and throws 784 // BUG: verify that all in and inoutparameters are read780 // BUG: verify that all in and ref parameters are read 785 781 frequire = frequire->semantic(sc2); 786 782 labtab = NULL; // so body can't refer to labels … … 1030 1026 1031 1027 v = (VarDeclaration *)parameters->data[i]; 1032 if ( (v->storage_class & (STCout | STCin)) ==STCout)1028 if (v->storage_class & STCout) 1033 1029 { 1034 1030 assert(v->init); branches/dmdfe/hdrgen.c
r360 r458 4 4 // All Rights Reserved 5 5 // Initial header generation implementation by Dave Fladebo 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/hdrgen.h
r360 r458 4 4 // All Rights Reserved 5 5 // initial header generation implementation by Dave Fladebo 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/html.c
r360 r458 3 3 // All Rights Reserved 4 4 // written by Walter Bright 5 // www.digitalmars.com5 // http://www.digitalmars.com 6 6 // License for redistribution is by either the Artistic License 7 7 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/html.h
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/identifier.c
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/identifier.h
r360 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/idgen.c
r414 r458 4 4 // All Rights Reserved 5 5 // written by Walter Bright 6 // www.digitalmars.com6 // http://www.digitalmars.com 7 7 // License for redistribution is by either the Artistic License 8 8 // in artistic.txt, or the GNU General Public License in gnu.txt. branches/dmdfe/impcnvgen.c
<
