Handle evaluation of statements, not just expressions.
Also handle statements in conditional breakpoints.
This is more consistent with other common debuggers (e.g. java, python).
Calls Parser#parseStatement with local parsing level, so some statement types aren't handled (e.g. load statements), which is broadly consistent with other debuggers.
Assignment, augmented assignment, and return statements return a non-None value,
and simple expression statements still return the result of evaluating the expression.
TAG_CHANGE_OK=This proto has never yet been used
TYPE_CHANGE_OK=This proto has never yet been used
PiperOrigin-RevId: 202135678
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/Debuggable.java b/src/main/java/com/google/devtools/build/lib/syntax/Debuggable.java
index 4540f55..ee871e6 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/Debuggable.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/Debuggable.java
@@ -22,8 +22,8 @@
/** A context in which debugging can occur. Implemented by Skylark environments. */
public interface Debuggable {
- /** Evaluates a Skylark expression in the adapter's environment. */
- Object evaluate(String expression) throws EvalException, InterruptedException;
+ /** Evaluates a Skylark statement in the adapter's environment. */
+ Object evaluate(String statement) throws EvalException, InterruptedException;
/**
* Returns the stack frames corresponding of the context's current (paused) state.