Changeset 229
- Timestamp:
- 10/31/09 23:02:07 (15 years ago)
- Files:
-
- branches/dmd-1.x/src/template.c (modified) (1 diff)
- trunk/src/template.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dmd-1.x/src/template.c
r207 r229 4244 4244 4245 4245 ti = (TemplateInstance *)ti->syntaxCopy(NULL); 4246 4246 id = (Identifier *)ti; 4247 4247 } 4248 4248 ids->data[i] = id; 4249 4249 } 4250 4250 4251 4251 tm = new TemplateMixin(loc, ident, 4252 4252 (Type *)(tqual ? tqual->syntaxCopy() : NULL), 4253 4253 ids, tiargs); 4254 4254 TemplateInstance::syntaxCopy(tm); 4255 4255 return tm; 4256 4256 } 4257 4257 4258 4258 void TemplateMixin::semantic(Scope *sc) 4259 4259 { 4260 4260 #if LOG 4261 4261 printf("+TemplateMixin::semantic('%s', this=%p)\n", toChars(), this); 4262 4262 fflush(stdout); 4263 4263 #endif 4264 if (semanticRun && 4264 if (semanticRun) 4265 { 4265 4266 // This for when a class/struct contains mixin members, and 4266 4267 // is done over because of forward references 4267 (!parent || !toParent()->isAggregateDeclaration())) 4268 { 4268 if (parent && toParent()->isAggregateDeclaration()) 4269 semanticRun = 1; // do over 4270 else 4271 { 4269 4272 #if LOG 4270 printf("\tsemantic done\n"); 4271 #endif 4272 return; 4273 printf("\tsemantic done\n"); 4274 #endif 4275 return; 4276 } 4273 4277 } 4274 4278 if (!semanticRun) 4275 4279 semanticRun = 1; 4276 4280 #if LOG 4277 4281 printf("\tdo semantic\n"); 4278 4282 #endif 4279 4283 util_progress(); 4280 4284 4281 4285 Scope *scx = NULL; 4282 4286 if (scope) 4283 4287 { sc = scope; 4284 4288 scx = scope; // save so we don't make redundant copies 4285 4289 scope = NULL; 4286 4290 } 4287 4291 4288 4292 // Follow qualifications to find the TemplateDeclaration 4289 4293 if (!tempdecl) 4290 4294 { Dsymbol *s; 4291 4295 int i; 4292 4296 Identifier *id; trunk/src/template.c
r223 r229 4502 4502 4503 4503 ti = (TemplateInstance *)ti->syntaxCopy(NULL); 4504 4504 id = (Identifier *)ti; 4505 4505 } 4506 4506 ids->data[i] = id; 4507 4507 } 4508 4508 4509 4509 tm = new TemplateMixin(loc, ident, 4510 4510 (Type *)(tqual ? tqual->syntaxCopy() : NULL), 4511 4511 ids, tiargs); 4512 4512 TemplateInstance::syntaxCopy(tm); 4513 4513 return tm; 4514 4514 } 4515 4515 4516 4516 void TemplateMixin::semantic(Scope *sc) 4517 4517 { 4518 4518 #if LOG 4519 4519 printf("+TemplateMixin::semantic('%s', this=%p)\n", toChars(), this); 4520 4520 fflush(stdout); 4521 4521 #endif 4522 if (semanticRun && 4522 if (semanticRun) 4523 { 4523 4524 // This for when a class/struct contains mixin members, and 4524 4525 // is done over because of forward references 4525 (!parent || !toParent()->isAggregateDeclaration())) 4526 { 4526 if (parent && toParent()->isAggregateDeclaration()) 4527 semanticRun = 1; // do over 4528 else 4529 { 4527 4530 #if LOG 4528 printf("\tsemantic done\n"); 4529 #endif 4530 return; 4531 printf("\tsemantic done\n"); 4532 #endif 4533 return; 4534 } 4531 4535 } 4532 4536 if (!semanticRun) 4533 4537 semanticRun = 1; 4534 4538 #if LOG 4535 4539 printf("\tdo semantic\n"); 4536 4540 #endif 4537 4541 util_progress(); 4538 4542 4539 4543 Scope *scx = NULL; 4540 4544 if (scope) 4541 4545 { sc = scope; 4542 4546 scx = scope; // save so we don't make redundant copies 4543 4547 scope = NULL; 4544 4548 } 4545 4549 4546 4550 // Follow qualifications to find the TemplateDeclaration 4547 4551 if (!tempdecl) 4548 4552 { Dsymbol *s; 4549 4553 int i; 4550 4554 Identifier *id;
