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

Method evalAsIterable

src/main/java/net/starlark/java/eval/Eval.java:945–954  ·  view source on GitHub ↗

Evaluates an expression to an iterable Starlark value and returns an Iterable view of it. If evaluation fails or the value is not iterable, throws EvalException and sets the error location to the expression's start.

(StarlarkThread.Frame fr, Expression expr)

Source from the content-addressed store, hash-verified

943 * error location to the expression's start.
944 */
945 private static Iterable<?> evalAsIterable(StarlarkThread.Frame fr, Expression expr)
946 throws EvalException, InterruptedException {
947 Object o = eval(fr, expr);
948 try {
949 return Starlark.toIterable(o);
950 } catch (EvalException ex) {
951 fr.setErrorLocation(expr.getStartLocation());
952 throw ex;
953 }
954 }
955
956 private static final Object[] EMPTY = {};
957}

Callers 2

execForMethod · 0.95
execClausesMethod · 0.80

Calls 4

evalMethod · 0.95
toIterableMethod · 0.95
setErrorLocationMethod · 0.80
getStartLocationMethod · 0.45

Tested by

no test coverage detected