()
| 1366 | |
| 1367 | // parse and return a parenthesized expression |
| 1368 | private ConditionData condition() throws IOException { |
| 1369 | ConditionData data = new ConditionData(); |
| 1370 | |
| 1371 | if (mustMatchToken(Token.LP, "msg.no.paren.cond", true)) data.lp = ts.tokenBeg; |
| 1372 | |
| 1373 | data.condition = expr(false); |
| 1374 | |
| 1375 | if (mustMatchToken(Token.RP, "msg.no.paren.after.cond", true)) data.rp = ts.tokenBeg; |
| 1376 | |
| 1377 | // Report strict warning on code like "if (a = 7) ...". Suppress the |
| 1378 | // warning if the condition is parenthesized, like "if ((a = 7)) ...". |
| 1379 | if (data.condition instanceof Assignment) { |
| 1380 | addStrictWarning( |
| 1381 | "msg.equal.as.assign", |
| 1382 | "", |
| 1383 | data.condition.getPosition(), |
| 1384 | data.condition.getLength()); |
| 1385 | } |
| 1386 | return data; |
| 1387 | } |
| 1388 | |
| 1389 | private AstNode statement() throws IOException { |
| 1390 | int pos = ts.tokenBeg; |
no test coverage detected