anchor.diff:      // to parse it as an expression statement. It isn't clear what the best
       // error message is in this case.
       parseStatement("int f { return x;}");
  -    assertErrorsWithCodes([ParserErrorCode.MISSING_FUNCTION_PARAMETERS]);
  +    listener.assertErrors(
  +        [expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 4, 1)]);
     }
   
     @failingTest
  
positive.code:   void test_invalidUnicodeEscape_incomplete_noDigits() {
      Expression expression = parseStringLiteral("'\\u{'");
      expectNotNullIfNoErrors(expression);
      listener.assertErrorsWithCodes([ParserErrorCode.INVALID_UNICODE_ESCAPE]);
    }
  
    void test_invalidUnicodeEscape_incomplete_someDigits() {
      Expression expression = parseStringLiteral("'\\u{0A'");
      expectNotNullIfNoErrors(expression);
      listener.assertErrorsWithCodes([ParserErrorCode.INVALID_UNICODE_ESCAPE]);
    }
  
    void test_invalidUnicodeEscape_invalidDigit() {
      Expression expression = parseStringLiteral("'\\u0 a'");
      expectNotNullIfNoErrors(expression);
      listener.assertErrorsWithCodes([ParserErrorCode.INVALID_UNICODE_ESCAPE]);
    }
  
    void test_invalidUnicodeEscape_tooFewDigits_fixed() {
      Expression expression = parseStringLiteral("'\\u04'");
      expectNotNullIfNoErrors(expression);
      listener.assertErrorsWithCodes([ParserErrorCode.INVALID_UNICODE_ESCAPE]);
    }
  
    void test_invalidUnicodeEscape_tooFewDigits_variable() {
      Expression expression = parseStringLiteral("'\\u{}'");
      expectNotNullIfNoErrors(expression);
      listener.assertErrorsWithCodes([ParserErrorCode.INVALID_UNICODE_ESCAPE]);
    }
  
    void test_invalidUnicodeEscape_tooManyDigits_variable() {
      Expression expression = parseStringLiteral("'\\u{12345678}'");
      expectNotNullIfNoErrors(expression);
      listener.assertErrorsWithCodes([
        ParserErrorCode.INVALID_UNICODE_ESCAPE,
        ParserErrorCode.INVALID_CODE_POINT
      ]);
    }
  
    void test_libraryDirectiveNotFirst() {
      parseCompilationUnit("import 'x.dart'; library l;",
          codes: [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
    }
  
    void test_libraryDirectiveNotFirst_afterPart() {
      CompilationUnit unit = parseCompilationUnit("part 'a.dart';\nlibrary l;",
          codes: [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
      expect(unit, isNotNull);
    }
  
    void test_localFunctionDeclarationModifier_abstract() {
      parseStatement("abstract f() {}");
      assertErrorsWithCodes(
          [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
    }
  
    void test_localFunctionDeclarationModifier_external() {
      parseStatement("external f() {}");
      assertErrorsWithCodes(
          [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
    }
  
    void test_localFunctionDeclarationModifier_factory() {
      parseStatement("factory f() {}");
      assertErrorsWithCodes(
          [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
    }
  
    void test_localFunctionDeclarationModifier_static() {
      parseStatement("static f() {}");
      assertErrorsWithCodes(
          [ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER]);
    }
  
    void test_method_invalidTypeParameterComments() {
  
negative.code:     createParser('(int a, int b ;');
      FormalParameterList list = parser.parseFormalParameterList();
      expectNotNullIfNoErrors(list);
      if (fe.Scanner.useFasta) {
        listener.assertErrors(
            [expectedError(ScannerErrorCode.EXPECTED_TOKEN, 14, 1)]);
      } else {
        listener
            .assertErrorsWithCodes([ParserErrorCode.MISSING_CLOSING_PARENTHESIS]);
      }
    }
  
    void test_missingConstFinalVarOrType_static() {
      parseCompilationUnit("class A { static f; }", errors: [
        expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 17, 1)
      ]);
    }
  
    void test_missingConstFinalVarOrType_topLevel() {
      parseCompilationUnit('a;', errors: [
        expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 0, 1)
      ]);
    }
  
    void test_missingEnumBody() {
      createParser('enum E;');
      EnumDeclaration declaration = parseFullCompilationUnitMember();
      expectNotNullIfNoErrors(declaration);
      listener
          .assertErrors([expectedError(ParserErrorCode.MISSING_ENUM_BODY, 6, 1)]);
    }
  
    void test_missingExpressionInThrow() {
      ThrowExpression expression =
          (parseStatement('throw;') as ExpressionStatement).expression;
      expectNotNullIfNoErrors(expression);
      listener.assertErrors(
          [expectedError(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, 5, 1)]);
    }
  
    void test_missingFunctionBody_emptyNotAllowed() {
  