()
| 601 | } |
| 602 | |
| 603 | void doFor() { |
| 604 | boolean saveLooseSyntax = looseSyntax; |
| 605 | looseSyntax = false; |
| 606 | loopDepth++; |
| 607 | inLoop = true; |
| 608 | getToken(); |
| 609 | if (token!='(') |
| 610 | error("'(' expected"); |
| 611 | getToken(); // skip 'var' |
| 612 | if (token!=VAR) |
| 613 | putTokenBack(); |
| 614 | do { |
| 615 | if (nextToken()!=';') |
| 616 | getAssignmentExpression(); |
| 617 | getToken(); |
| 618 | } while (token==','); |
| 619 | if (token!=';') |
| 620 | error("';' expected"); |
| 621 | int condPC = pc; |
| 622 | int incPC2, startPC=0; |
| 623 | double cond = 1; |
| 624 | while (true) { |
| 625 | if (pgm.code[pc+1]!=';') |
| 626 | cond = getLogicalExpression(); |
| 627 | if (startPC==0) |
| 628 | checkBoolean(cond); |
| 629 | getToken(); |
| 630 | if (token!=';') |
| 631 | error("';' expected"); |
| 632 | int incPC = pc; |
| 633 | // skip to start of code |
| 634 | if (startPC!=0) |
| 635 | pc = startPC; |
| 636 | else { |
| 637 | while (token!=')') { |
| 638 | getToken(); |
| 639 | //IJ.log(pgm.decodeToken(token,tokenAddress)); |
| 640 | if (token=='{' || token==';' || token=='(' || done) |
| 641 | error("')' expected"); |
| 642 | } |
| 643 | } |
| 644 | startPC = pc; |
| 645 | if (cond==1) { |
| 646 | try { |
| 647 | doStatement(); |
| 648 | } catch(MacroException e) { |
| 649 | if (e.getType()==BREAK) { |
| 650 | pc = startPC; |
| 651 | skipStatement(); |
| 652 | break; |
| 653 | } |
| 654 | } |
| 655 | } else { |
| 656 | skipStatement(); |
| 657 | break; |
| 658 | } |
| 659 | pc = incPC; // do increment |
| 660 | do { |
no test coverage detected