(Label label, LabeledStatement bundle)
| 2382 | } |
| 2383 | |
| 2384 | private void recordLabel(Label label, LabeledStatement bundle) throws IOException { |
| 2385 | // current token should be colon that primaryExpr left untouched |
| 2386 | if (peekToken() != Token.COLON) codeBug(); |
| 2387 | consumeToken(); |
| 2388 | String name = label.getName(); |
| 2389 | if (labelSet == null) { |
| 2390 | labelSet = new HashMap<>(); |
| 2391 | } else { |
| 2392 | LabeledStatement ls = labelSet.get(name); |
| 2393 | if (ls != null) { |
| 2394 | if (compilerEnv.isIdeMode()) { |
| 2395 | Label dup = ls.getLabelByName(name); |
| 2396 | reportError("msg.dup.label", dup.getAbsolutePosition(), dup.getLength()); |
| 2397 | } |
| 2398 | reportError("msg.dup.label", label.getPosition(), label.getLength()); |
| 2399 | } |
| 2400 | } |
| 2401 | bundle.addLabel(label); |
| 2402 | labelSet.put(name, bundle); |
| 2403 | } |
| 2404 | |
| 2405 | /** |
| 2406 | * Found a name in a statement context. If it's a label, we gather up any following labels and |
no test coverage detected