Mercurial > projects > ldc
comparison dmd/expression.c @ 717:a26b0c5d5942
Merged DMD 1.036.
Improved comments a little in the runtime source code.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 22 Oct 2008 17:06:17 +0200 |
parents | eef8ac26c66c |
children | 55f6c2e454d7 |
comparison
equal
deleted
inserted
replaced
716:b654bb98d31d | 717:a26b0c5d5942 |
---|---|
4632 { | 4632 { |
4633 #if LOGSEMANTIC | 4633 #if LOGSEMANTIC |
4634 printf("BinExp::semantic('%s')\n", toChars()); | 4634 printf("BinExp::semantic('%s')\n", toChars()); |
4635 #endif | 4635 #endif |
4636 e1 = e1->semantic(sc); | 4636 e1 = e1->semantic(sc); |
4637 if (!e1->type) | 4637 if (!e1->type && |
4638 !(op == TOKassign && e1->op == TOKdottd)) // a.template = e2 | |
4638 { | 4639 { |
4639 error("%s has no value", e1->toChars()); | 4640 error("%s has no value", e1->toChars()); |
4640 e1->type = Type::terror; | 4641 e1->type = Type::terror; |
4641 } | 4642 } |
4642 e2 = e2->semantic(sc); | 4643 e2 = e2->semantic(sc); |
4643 if (!e2->type) | 4644 if (!e2->type) |
4644 { | 4645 { |
4645 error("%s has no value", e2->toChars()); | 4646 error("%s has no value", e2->toChars()); |
4646 e2->type = Type::terror; | 4647 e2->type = Type::terror; |
4647 } | 4648 } |
4648 assert(e1->type); | |
4649 return this; | 4649 return this; |
4650 } | 4650 } |
4651 | 4651 |
4652 Expression *BinExp::semanticp(Scope *sc) | 4652 Expression *BinExp::semanticp(Scope *sc) |
4653 { | 4653 { |
7349 } | 7349 } |
7350 } | 7350 } |
7351 } | 7351 } |
7352 | 7352 |
7353 BinExp::semantic(sc); | 7353 BinExp::semantic(sc); |
7354 | |
7355 if (e1->op == TOKdottd) | |
7356 { // Rewrite a.b=e2, when b is a template, as a.b(e2) | |
7357 Expression *e = new CallExp(loc, e1, e2); | |
7358 e = e->semantic(sc); | |
7359 return e; | |
7360 } | |
7361 | |
7354 e2 = resolveProperties(sc, e2); | 7362 e2 = resolveProperties(sc, e2); |
7355 assert(e1->type); | 7363 assert(e1->type); |
7356 | 7364 |
7357 /* Rewrite tuple assignment as a tuple of assignments. | 7365 /* Rewrite tuple assignment as a tuple of assignments. |
7358 */ | 7366 */ |