comparison dmd/interpret.c @ 1613:8f50a13d09a0

Merge DMD r286: remove dead code --- dmd/interpret.c | 49 ++----------------------------------------------- dmd/mars.c | 2 +- 2 files changed, 3 insertions(+), 48 deletions(-)
author Leandro Lucarella <llucax@gmail.com>
date Wed, 06 Jan 2010 15:18:21 -0300
parents 207a8a438dea
children c61782a76dff
comparison
equal deleted inserted replaced
1612:081c48283153 1613:8f50a13d09a0
498 Expression *WhileStatement::interpret(InterState *istate) 498 Expression *WhileStatement::interpret(InterState *istate)
499 { 499 {
500 #if LOG 500 #if LOG
501 printf("WhileStatement::interpret()\n"); 501 printf("WhileStatement::interpret()\n");
502 #endif 502 #endif
503 if (istate->start == this) 503 assert(0); // rewritten to ForStatement
504 istate->start = NULL; 504 return NULL;
505 Expression *e;
506
507 if (istate->start)
508 {
509 e = body ? body->interpret(istate) : NULL;
510 if (istate->start)
511 return NULL;
512 if (e == EXP_CANT_INTERPRET)
513 return e;
514 if (e == EXP_BREAK_INTERPRET)
515 return NULL;
516 if (e && e != EXP_CONTINUE_INTERPRET)
517 return e;
518 }
519
520 while (1)
521 {
522 e = condition->interpret(istate);
523 if (e == EXP_CANT_INTERPRET)
524 break;
525 if (!e->isConst())
526 { e = EXP_CANT_INTERPRET;
527 break;
528 }
529 if (e->isBool(TRUE))
530 { e = body ? body->interpret(istate) : NULL;
531 if (e == EXP_CANT_INTERPRET)
532 break;
533 if (e == EXP_CONTINUE_INTERPRET)
534 continue;
535 if (e == EXP_BREAK_INTERPRET)
536 { e = NULL;
537 break;
538 }
539 if (e)
540 break;
541 }
542 else if (e->isBool(FALSE))
543 { e = NULL;
544 break;
545 }
546 else
547 assert(0);
548 }
549 return e;
550 } 505 }
551 506
552 Expression *DoStatement::interpret(InterState *istate) 507 Expression *DoStatement::interpret(InterState *istate)
553 { 508 {
554 #if LOG 509 #if LOG