MCPcopy Index your code
hub / github.com/bazelbuild/bazel / evalDict

Method evalDict

src/main/java/net/starlark/java/eval/Eval.java:634–653  ·  view source on GitHub ↗
(StarlarkThread.Frame fr, DictExpression dictexpr)

Source from the content-addressed store, hash-verified

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 {

Callers 1

evalMethod · 0.95

Calls 12

ofMethod · 0.95
evalMethod · 0.95
errorfMethod · 0.95
reprMethod · 0.95
getEntriesMethod · 0.80
putEntryMethod · 0.80
setErrorLocationMethod · 0.80
getColonLocationMethod · 0.80
mutabilityMethod · 0.65
getValueMethod · 0.65
getKeyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected