anchor.diff:  }''');
       CompilationUnit unit = parser.parseCompilationUnit2();
       expectNotNullIfNoErrors(unit);
  -    listener.assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]);
  +    listener
  +        .assertErrors([expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 30, 1)]);
     }
   
     void test_getterInFunction_block_noReturnType() {
       FunctionDeclarationStatement statement =
           parseStatement("get x { return _x; }");
  -    assertErrorsWithCodes([ParserErrorCode.GETTER_IN_FUNCTION]);
  +    listener.assertErrors(
  +        [expectedError(ParserErrorCode.GETTER_IN_FUNCTION, 0, 3)]);
       expect(statement.functionDeclaration.functionExpression.parameters, isNull);
     }
   
     void test_getterInFunction_block_returnType() {
       parseStatement("int get x { return _x; }");
  -    assertErrorsWithCodes([ParserErrorCode.GETTER_IN_FUNCTION]);
  +    listener.assertErrors(
  +        [expectedError(ParserErrorCode.GETTER_IN_FUNCTION, 4, 3)]);
     }
   
     void test_getterInFunction_expression_noReturnType() {
       parseStatement("get x => _x;");
  -    assertErrorsWithCodes([ParserErrorCode.GETTER_IN_FUNCTION]);
  +    listener.assertErrors(
  +        [expectedError(ParserErrorCode.GETTER_IN_FUNCTION, 0, 3)]);
     }
   
     void test_getterInFunction_expression_returnType() {
       parseStatement("int get x => _x;");
  -    assertErrorsWithCodes([ParserErrorCode.GETTER_IN_FUNCTION]);
  +    listener.assertErrors(
  +        [expectedError(ParserErrorCode.GETTER_IN_FUNCTION, 4, 3)]);
     }
   
     void test_getterWithParameters() {
       createParser('int get x() {}');
       ClassMember member = parser.parseClassMember('C');
       expectNotNullIfNoErrors(member);
  +    // TODO(brianwilkerson) Convert codes to errors when highlighting is fixed.
       listener.assertErrorsWithCodes([ParserErrorCode.GETTER_WITH_PARAMETERS]);
  +//    listener.assertErrors(
  +//        [expectedError(ParserErrorCode.GETTER_WITH_PARAMETERS, 9, 2)]);
     }
   
     void test_illegalAssignmentToNonAssignable_postfix_minusMinus_literal() {
  -    parseExpression("0--",
  -        codes: [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
  +    parseExpression("0--", errors: [
  +      expectedError(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 1, 2)
  +    ]);
     }
   
     void test_illegalAssignmentToNonAssignable_postfix_plusPlus_literal() {
  -    parseExpression("0++",
  -        codes: [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
  +    parseExpression("0++", errors: [
  +      expectedError(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 1, 2)
  +    ]);
     }
   
     void test_illegalAssignmentToNonAssignable_postfix_plusPlus_parenthesized() {
  -    parseExpression("(x)++",
  -        codes: [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
  +    parseExpression("(x)++", errors: [
  +      expectedError(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 3, 2)
  +    ]);
     }
   
     void test_illegalAssignmentToNonAssignable_primarySelectorPostfix() {
  -    parseExpression("x(y)(z)++",
  -        codes: [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
  +    parseExpression("x(y)(z)++", errors: [
  +      expectedError(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 7, 2)
  +    ]);
     }
   
     void test_illegalAssignmentToNonAssignable_superAssigned() {
  
positive.code:         : [ParserErrorCode.FINAL_AND_COVARIANT]);
    }
  
    void test_finalAndCovariant() {
      createParser('final covariant f = null;');
      ClassMember member = parser.parseClassMember('C');
      expectNotNullIfNoErrors(member);
      listener.assertErrorsWithCodes([ParserErrorCode.FINAL_AND_COVARIANT]);
    }
  
    void test_finalAndVar() {
      createParser('final var x = null;');
      ClassMember member = parser.parseClassMember('C');
      expectNotNullIfNoErrors(member);
      listener.assertErrorsWithCodes([ParserErrorCode.FINAL_AND_VAR]);
    }
  
    void test_finalClass() {
      parseCompilationUnit("final class C {}",
          codes: [ParserErrorCode.FINAL_CLASS]);
    }
  
    void test_finalConstructor() {
      createParser('final C() {}');
      ClassMember member = parser.parseClassMember('C');
      expectNotNullIfNoErrors(member);
      listener.assertErrorsWithCodes(usingFastaParser
          ? [ParserErrorCode.EXTRANEOUS_MODIFIER]
          : [ParserErrorCode.FINAL_CONSTRUCTOR]);
    }
  
    void test_finalEnum() {
      parseCompilationUnit("final enum E {ONE}",
          codes: [ParserErrorCode.FINAL_ENUM]);
    }
  
    void test_finalMethod() {
      createParser('final int m() {}');
      ClassMember member = parser.parseClassMember('C');
      expectNotNullIfNoErrors(member);
      listener.assertErrorsWithCodes(usingFastaParser
          ? [ParserErrorCode.EXTRANEOUS_MODIFIER]
          : [ParserErrorCode.FINAL_METHOD]);
    }
  
    void test_finalTypedef() {
      parseCompilationUnit("final typedef F();",
          codes: [ParserErrorCode.FINAL_TYPEDEF]);
    }
  
    void test_functionTypedParameter_const() {
      parseCompilationUnit("void f(const x()) {}",
          codes: [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
    }
  
    void test_functionTypedParameter_final() {
      parseCompilationUnit("void f(final x()) {}",
          codes: [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
    }
  
    void test_functionTypedParameter_incomplete1() {
      // This caused an exception at one point.
      parseCompilationUnit("void f(int Function(",
          codes: fe.Scanner.useFasta
              ? [
                  ScannerErrorCode.EXPECTED_TOKEN,
                  ScannerErrorCode.EXPECTED_TOKEN,
                  ParserErrorCode.MISSING_FUNCTION_BODY,
                  ParserErrorCode.MISSING_IDENTIFIER,
                ]
              : [
                  ParserErrorCode.MISSING_FUNCTION_BODY,
                  ParserErrorCode.MISSING_CLOSING_PARENTHESIS,
                  ParserErrorCode.EXPECTED_EXECUTABLE,
                  ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE,
                  ParserErrorCode.EXPECTED_TOKEN,
                  ParserErrorCode.EXPECTED_TOKEN
                ]);
    }
  
    void test_functionTypedParameter_var() {
      parseCompilationUnit("void f(var x()) {}",
          codes: [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
    }
  
    void test_genericFunctionType_extraLessThan() {
  
negative.code:         [expectedError(ParserErrorCode.COVARIANT_AFTER_VAR, 4, 9)]);
    }
  
    void test_covariantAndFinal() {
      createParser('covariant final f = null;');
      ClassMember member = parser.parseClassMember('C');
  