Automated rollback of commit e114d8a04fe07dd32fee41b3cd2e5794f10a5a9d.

*** Reason for rollback ***

TAP has detected 10 or more targets failed to build at https://github.com/bazelbuild/bazel/commit/e114d8a04fe07dd32fee41b3cd2e5794f10a5a9d.

TO ROLLFORWARD (without additional approval): Use[]

To see all broken targets visit []
To prevent noise from flakes, TAP double-checked the following target fails to build:
[]
but used to build fine:
[]

Questions? Comments? See the URL:[]

*** Original change description ***

bazel syntax: don't use exceptions for control flow

Previously, break, continue, and return were implemented by
throwing and catching exceptions.

Now, the Eval.exec methods return a token to indicate the
continuation: one of PASS, BREAK, CONTINUE, or RETURN.
In addition, the return value is saved in the Eval,
which is good for only one function invocation.

This is simpler (and slightly more efficient).

Also:
- FlowStatement now includes PASS too; PassStatement is gone.
- ReturnException is g...

***

PiperOrigin-RevId: 255883540
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java b/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
index 28d7a2a..15bbe94 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/ParserTest.java
@@ -608,33 +608,28 @@
   }
 
   @Test
-  public void testForBreakContinuePass() throws Exception {
-    List<Statement> file =
-        parseFileForSkylark(
-            "def foo():",
-            "  for i in [1, 2]:",
-            "    break",
-            "    continue",
-            "    pass",
-            "    break");
+  public void testForBreakContinue() throws Exception {
+    List<Statement> file = parseFileForSkylark(
+        "def foo():",
+        "  for i in [1, 2]:",
+        "    break",
+        "    continue",
+        "    break");
     assertThat(file).hasSize(1);
     List<Statement> body = ((FunctionDefStatement) file.get(0)).getStatements();
     assertThat(body).hasSize(1);
 
     List<Statement> loop = ((ForStatement) body.get(0)).getBlock();
-    assertThat(loop).hasSize(4);
+    assertThat(loop).hasSize(3);
 
-    assertThat(((FlowStatement) loop.get(0)).getKind()).isEqualTo(TokenKind.BREAK);
+    assertThat(((FlowStatement) loop.get(0)).getKind()).isEqualTo(FlowStatement.Kind.BREAK);
     assertLocation(34, 39, loop.get(0).getLocation());
 
-    assertThat(((FlowStatement) loop.get(1)).getKind()).isEqualTo(TokenKind.CONTINUE);
+    assertThat(((FlowStatement) loop.get(1)).getKind()).isEqualTo(FlowStatement.Kind.CONTINUE);
     assertLocation(44, 52, loop.get(1).getLocation());
 
-    assertThat(((FlowStatement) loop.get(2)).getKind()).isEqualTo(TokenKind.PASS);
-    assertLocation(57, 61, loop.get(2).getLocation());
-
-    assertThat(((FlowStatement) loop.get(3)).getKind()).isEqualTo(TokenKind.BREAK);
-    assertLocation(66, 71, loop.get(3).getLocation());
+    assertThat(((FlowStatement) loop.get(2)).getKind()).isEqualTo(FlowStatement.Kind.BREAK);
+    assertLocation(57, 62, loop.get(2).getLocation());
   }
 
   @Test
@@ -1019,6 +1014,13 @@
   }
 
   @Test
+  public void testPass() throws Exception {
+    List<Statement> statements = parseFileForSkylark("pass\n");
+    assertThat(statements).hasSize(1);
+    assertThat(statements.get(0)).isInstanceOf(PassStatement.class);
+  }
+
+  @Test
   public void testForPass() throws Exception {
     List<Statement> statements = parseFileForSkylark(
         "def foo():",
@@ -1026,7 +1028,7 @@
 
     assertThat(statements).hasSize(1);
     FunctionDefStatement stmt = (FunctionDefStatement) statements.get(0);
-    assertThat(stmt.getStatements().get(0)).isInstanceOf(FlowStatement.class);
+    assertThat(stmt.getStatements().get(0)).isInstanceOf(PassStatement.class);
   }
 
   @Test