()
| 1578 | } |
| 1579 | |
| 1580 | private IfStatement ifStatement() throws IOException { |
| 1581 | if (currentToken != Token.IF) codeBug(); |
| 1582 | consumeToken(); |
| 1583 | int pos = ts.tokenBeg, lineno = lineNumber(), elsePos = -1, column = columnNumber(); |
| 1584 | IfStatement pn = new IfStatement(pos); |
| 1585 | ConditionData data = condition(); |
| 1586 | AstNode ifTrue = getNextStatementAfterInlineComments(pn), ifFalse = null; |
| 1587 | if (matchToken(Token.ELSE, true)) { |
| 1588 | int tt = peekToken(); |
| 1589 | if (tt == Token.COMMENT) { |
| 1590 | pn.setElseKeyWordInlineComment(scannedComments.get(scannedComments.size() - 1)); |
| 1591 | consumeToken(); |
| 1592 | } |
| 1593 | elsePos = ts.tokenBeg - pos; |
| 1594 | ifFalse = statement(); |
| 1595 | } |
| 1596 | int end = getNodeEnd(ifFalse != null ? ifFalse : ifTrue); |
| 1597 | pn.setLength(end - pos); |
| 1598 | pn.setCondition(data.condition); |
| 1599 | pn.setParens(data.lp - pos, data.rp - pos); |
| 1600 | pn.setThenPart(ifTrue); |
| 1601 | pn.setElsePart(ifFalse); |
| 1602 | pn.setElsePosition(elsePos); |
| 1603 | pn.setLineColumnNumber(lineno, column); |
| 1604 | return pn; |
| 1605 | } |
| 1606 | |
| 1607 | private SwitchStatement switchStatement() throws IOException { |
| 1608 | if (currentToken != Token.SWITCH) codeBug(); |
no test coverage detected