()
| 3697 | } |
| 3698 | |
| 3699 | private AstNode parenExpr() throws IOException { |
| 3700 | boolean wasInForInit = inForInit; |
| 3701 | inForInit = false; |
| 3702 | try { |
| 3703 | Comment jsdocNode = getAndResetJsDoc(); |
| 3704 | int lineno = lineNumber(), column = columnNumber(); |
| 3705 | int begin = ts.tokenBeg; |
| 3706 | AstNode e = (peekToken() == Token.RP ? new EmptyExpression(begin) : expr(true)); |
| 3707 | if (peekToken() == Token.FOR) { |
| 3708 | return generatorExpression(e, begin); |
| 3709 | } |
| 3710 | mustMatchToken(Token.RP, "msg.no.paren", true); |
| 3711 | |
| 3712 | int length = ts.tokenEnd - begin; |
| 3713 | |
| 3714 | boolean hasObjectLiteralDestructuring = |
| 3715 | e.getIntProp(Node.OBJECT_LITERAL_DESTRUCTURING, 0) == 1; |
| 3716 | boolean hasTrailingComma = e.getIntProp(Node.TRAILING_COMMA, 0) == 1; |
| 3717 | if ((hasTrailingComma || hasObjectLiteralDestructuring || e.getType() == Token.EMPTY) |
| 3718 | && peekToken() != Token.ARROW) { |
| 3719 | reportError("msg.syntax"); |
| 3720 | return makeErrorNode(); |
| 3721 | } |
| 3722 | |
| 3723 | ParenthesizedExpression pn = new ParenthesizedExpression(begin, length, e); |
| 3724 | pn.setLineColumnNumber(lineno, column); |
| 3725 | if (jsdocNode == null) { |
| 3726 | jsdocNode = getAndResetJsDoc(); |
| 3727 | } |
| 3728 | if (jsdocNode != null) { |
| 3729 | pn.setJsDocNode(jsdocNode); |
| 3730 | } |
| 3731 | if (hasTrailingComma) { |
| 3732 | pn.putIntProp(Node.TRAILING_COMMA, 1); |
| 3733 | } |
| 3734 | return pn; |
| 3735 | } finally { |
| 3736 | inForInit = wasInForInit; |
| 3737 | } |
| 3738 | } |
| 3739 | |
| 3740 | private AstNode name(int ttFlagged, int tt) throws IOException { |
| 3741 | String nameString = ts.getString(); |
no test coverage detected