(StarlarkThread.Frame fr, DictExpression dictexpr)
| 632 | } |
| 633 | |
| 634 | private static Object evalDict(StarlarkThread.Frame fr, DictExpression dictexpr) |
| 635 | throws EvalException, InterruptedException { |
| 636 | Dict<Object, Object> dict = Dict.of(fr.thread.mutability()); |
| 637 | for (DictExpression.Entry entry : dictexpr.getEntries()) { |
| 638 | Object k = eval(fr, entry.getKey()); |
| 639 | Object v = eval(fr, entry.getValue()); |
| 640 | int before = dict.size(); |
| 641 | try { |
| 642 | dict.putEntry(k, v); |
| 643 | } catch (EvalException ex) { |
| 644 | fr.setErrorLocation(entry.getColonLocation()); |
| 645 | throw ex; |
| 646 | } |
| 647 | if (dict.size() == before) { |
| 648 | fr.setErrorLocation(entry.getColonLocation()); |
| 649 | throw Starlark.errorf("dictionary expression has duplicate key: %s", Starlark.repr(k)); |
| 650 | } |
| 651 | } |
| 652 | return dict; |
| 653 | } |
| 654 | |
| 655 | private static Object evalDot(StarlarkThread.Frame fr, DotExpression dot) |
| 656 | throws EvalException, InterruptedException { |
no test coverage detected