comparison dmd2/arrayop.c @ 1526:54b3c1394d62

Merged dmdfe 2.031.
author Robert Clipsham <robert@octarineparrot.com>
date Tue, 07 Jul 2009 02:26:11 +0100
parents 638d16625da2
children e4f7b5d9c68a
comparison
equal deleted inserted replaced
1525:d28cd7c45267 1526:54b3c1394d62
1 1
2 // Copyright (c) 1999-2008 by Digital Mars 2 // Copyright (c) 1999-2009 by Digital Mars
3 // All Rights Reserved 3 // All Rights Reserved
4 // written by Walter Bright 4 // written by Walter Bright
5 // http://www.digitalmars.com 5 // http://www.digitalmars.com
6 // License for redistribution is by either the Artistic License 6 // License for redistribution is by either the Artistic License
7 // in artistic.txt, or the GNU General Public License in gnu.txt. 7 // in artistic.txt, or the GNU General Public License in gnu.txt.
433 Expression *AssignExp::buildArrayLoop(Arguments *fparams) 433 Expression *AssignExp::buildArrayLoop(Arguments *fparams)
434 { 434 {
435 /* Evaluate assign expressions right to left 435 /* Evaluate assign expressions right to left
436 */ 436 */
437 Expression *ex2 = e2->buildArrayLoop(fparams); 437 Expression *ex2 = e2->buildArrayLoop(fparams);
438 /* Need the cast because:
439 * b = c + p[i];
440 * where b is a byte fails because (c + p[i]) is an int
441 * which cannot be implicitly cast to byte.
442 */
443 ex2 = new CastExp(0, ex2, e1->type->nextOf());
438 Expression *ex1 = e1->buildArrayLoop(fparams); 444 Expression *ex1 = e1->buildArrayLoop(fparams);
439 Argument *param = (Argument *)fparams->data[0]; 445 Argument *param = (Argument *)fparams->data[0];
440 param->storageClass = 0; 446 param->storageClass = 0;
441 Expression *e = new AssignExp(0, ex1, ex2); 447 Expression *e = new AssignExp(0, ex1, ex2);
442 return e; 448 return e;