Remove dialect distinction from the parser.

RELNOTES: None.
PiperOrigin-RevId: 166058718
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 784b0a7..94cdb30 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
@@ -914,22 +914,6 @@
   }
 
   @Test
-  public void testFunctionDefinitionErrorRecovery() throws Exception {
-    // Parser skips over entire function definitions, and reports a meaningful
-    // error.
-    setFailFast(false);
-    List<Statement> stmts = parseFile(
-        "x = 1;\n"
-        + "def foo(x, y, **z):\n"
-        + "  # a comment\n"
-        + "  x = 2\n"
-        + "  foo(bar)\n"
-        + "  return z\n"
-        + "x = 3");
-    assertThat(stmts).hasSize(2);
-  }
-
-  @Test
   public void testDefSingleLine() throws Exception {
     List<Statement> statements = parseFileForSkylark(
         "def foo(): x = 1; y = 2\n");
@@ -955,19 +939,6 @@
   }
 
   @Test
-  public void testSkipIfBlockFail() throws Exception {
-    // Do not parse 'if' blocks, when parsePython is not set
-    setFailFast(false);
-    List<Statement> stmts = parseFile(
-        "x = 1;",
-        "if x == 1:",
-        "  x = 2",
-        "x = 3;\n");
-    assertThat(stmts).hasSize(2);
-    assertContainsError("This is not supported in BUILD files");
-  }
-
-  @Test
   public void testForLoopMultipleVariables() throws Exception {
     List<Statement> stmts1 = parseFile("[ i for i, j, k in [(1, 2, 3)] ]\n");
     assertThat(stmts1).hasSize(1);
@@ -1402,7 +1373,7 @@
         "def func(a):",
         // no if
         "  else: return a");
-    assertContainsError("syntax error at 'else': not allowed here.");
+    assertContainsError("syntax error at 'else': expected expression");
   }
 
   @Test
@@ -1413,42 +1384,36 @@
         "  for i in range(a):",
         "    print(i)",
         "  else: return a");
-    assertContainsError("syntax error at 'else': not allowed here.");
+    assertContainsError("syntax error at 'else': expected expression");
   }
 
   @Test
   public void testTryStatementInBuild() throws Exception {
     setFailFast(false);
     parseFile("try: pass");
-    assertContainsError("syntax error at 'try': Try statements are not supported.");
-  }
-
-  @Test
-  public void testTryStatementInSkylark() throws Exception {
-    setFailFast(false);
-    parseFileForSkylark("try: pass");
-    assertContainsError("syntax error at 'try': Try statements are not supported.");
+    assertContainsError("'try' not supported, all exceptions are fatal");
   }
 
   @Test
   public void testClassDefinitionInBuild() throws Exception {
     setFailFast(false);
-    parseFile("class test(object): pass");
-    assertContainsError("syntax error at 'class': Class definitions are not supported.");
+    parseFileWithComments("class test(object): pass");
+    assertContainsError("keyword 'class' not supported");
   }
 
   @Test
   public void testClassDefinitionInSkylark() throws Exception {
     setFailFast(false);
     parseFileForSkylark("class test(object): pass");
-    assertContainsError("syntax error at 'class': Class definitions are not supported.");
+    assertContainsError("keyword 'class' not supported");
   }
 
   @Test
   public void testDefInBuild() throws Exception {
     setFailFast(false);
-    parseFile("def func(): pass");
+    BuildFileAST result = parseFileWithComments("def func(): pass");
     assertContainsError("syntax error at 'def': This is not supported in BUILD files. "
         + "Move the block to a .bzl file and load it");
+    assertThat(result.containsErrors()).isTrue();
   }
 }