()
| 1715 | } |
| 1716 | |
| 1717 | private DoLoop doLoop() throws IOException { |
| 1718 | if (currentToken != Token.DO) codeBug(); |
| 1719 | consumeToken(); |
| 1720 | int pos = ts.tokenBeg, end; |
| 1721 | DoLoop pn = new DoLoop(pos); |
| 1722 | pn.setLineColumnNumber(lineNumber(), columnNumber()); |
| 1723 | enterLoop(pn); |
| 1724 | try { |
| 1725 | AstNode body = getNextStatementAfterInlineComments(pn); |
| 1726 | mustMatchToken(Token.WHILE, "msg.no.while.do", true); |
| 1727 | pn.setWhilePosition(ts.tokenBeg - pos); |
| 1728 | ConditionData data = condition(); |
| 1729 | pn.setCondition(data.condition); |
| 1730 | pn.setParens(data.lp - pos, data.rp - pos); |
| 1731 | end = getNodeEnd(body); |
| 1732 | restoreRelativeLoopPosition(pn); |
| 1733 | pn.setBody(body); |
| 1734 | } finally { |
| 1735 | exitLoop(); |
| 1736 | } |
| 1737 | // Always auto-insert semicolon to follow SpiderMonkey: |
| 1738 | // It is required by ECMAScript but is ignored by the rest of |
| 1739 | // world, see bug 238945 |
| 1740 | if (matchToken(Token.SEMI, true)) { |
| 1741 | end = ts.tokenEnd; |
| 1742 | } |
| 1743 | pn.setLength(end - pos); |
| 1744 | return pn; |
| 1745 | } |
| 1746 | |
| 1747 | private int peekUntilNonComment(int tt) throws IOException { |
| 1748 | while (tt == Token.COMMENT) { |
no test coverage detected