Cleanups for Skylark tracebacks
In Skylark.java, fix line numbers to start at 1 instead of 2.
In Eval.java, go through maybeTransformException for consistency with expressions, even though no statement nodes use this feature.
In EvalExceptionWithStackTrace, fix style violation (non-consecutive overloads) and add TODO explaining an open issue.
RELNOTES: None
PiperOrigin-RevId: 169769928
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/Eval.java b/src/main/java/com/google/devtools/build/lib/syntax/Eval.java
index b7b91d4..6fd1f28 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/Eval.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/Eval.java
@@ -174,6 +174,14 @@
* @throws InterruptedException may be thrown in a sub class.
*/
public void exec(Statement st) throws EvalException, InterruptedException {
+ try {
+ execDispatch(st);
+ } catch (EvalException ex) {
+ throw st.maybeTransformException(ex);
+ }
+ }
+
+ void execDispatch(Statement st) throws EvalException, InterruptedException {
switch (st.kind()) {
case ASSIGNMENT:
execAssignment((AssignmentStatement) st);