| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.test_support; | 8 library engine.test_support; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/java_core.dart'; | 10 import 'package:analyzer/src/generated/java_core.dart'; |
| 11 import 'package:analyzer/src/generated/java_junit.dart'; | 11 import 'package:analyzer/src/generated/java_junit.dart'; |
| 12 import 'package:analyzer/src/generated/java_engine.dart'; | 12 import 'package:analyzer/src/generated/java_engine.dart'; |
| 13 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
| 14 import 'package:analyzer/src/generated/error.dart'; | 14 import 'package:analyzer/src/generated/error.dart'; |
| 15 import 'package:analyzer/src/generated/scanner.dart'; | 15 import 'package:analyzer/src/generated/scanner.dart'; |
| 16 import 'package:analyzer/src/generated/ast.dart' show AstNode, NodeLocator; | 16 import 'package:analyzer/src/generated/ast.dart' show AstNode, NodeLocator; |
| 17 import 'package:analyzer/src/generated/element.dart' show InterfaceType, MethodE
lement, PropertyAccessorElement; | 17 import 'package:analyzer/src/generated/element.dart' show InterfaceType, MethodE
lement, PropertyAccessorElement; |
| 18 import 'package:analyzer/src/generated/engine.dart'; | 18 import 'package:analyzer/src/generated/engine.dart'; |
| 19 import 'package:unittest/unittest.dart' as _ut; | 19 import 'package:unittest/unittest.dart' as _ut; |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Instances of the class `GatheringErrorListener` implement an error listener t
hat collects | 22 * Instances of the class `GatheringErrorListener` implement an error listener t
hat collects |
| 23 * all of the errors passed to it for later examination. | 23 * all of the errors passed to it for later examination. |
| 24 */ | 24 */ |
| 25 class GatheringErrorListener implements AnalysisErrorListener { | 25 class GatheringErrorListener implements AnalysisErrorListener { |
| 26 /** | 26 /** |
| 27 * The source being parsed. | 27 * The source being parsed. |
| 28 */ | 28 */ |
| 29 final String _rawSource; | 29 String _rawSource; |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * The source being parsed after inserting a marker at the beginning and end o
f the range of the | 32 * The source being parsed after inserting a marker at the beginning and end o
f the range of the |
| 33 * most recent error. | 33 * most recent error. |
| 34 */ | 34 */ |
| 35 String _markedSource; | 35 String _markedSource; |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * A list containing the errors that were collected. | 38 * A list containing the errors that were collected. |
| 39 */ | 39 */ |
| 40 List<AnalysisError> _errors = new List<AnalysisError>(); | 40 List<AnalysisError> _errors = new List<AnalysisError>(); |
| 41 | 41 |
| 42 /** | 42 /** |
| 43 * A table mapping sources to the line information for the source. | 43 * A table mapping sources to the line information for the source. |
| 44 */ | 44 */ |
| 45 Map<Source, LineInfo> _lineInfoMap = new Map<Source, LineInfo>(); | 45 Map<Source, LineInfo> _lineInfoMap = new Map<Source, LineInfo>(); |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * An empty array of errors used when no errors are expected. | 48 * An empty array of errors used when no errors are expected. |
| 49 */ | 49 */ |
| 50 static List<AnalysisError> _NO_ERRORS = new List<AnalysisError>(0); | 50 static List<AnalysisError> _NO_ERRORS = new List<AnalysisError>(0); |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * Initialize a newly created error listener to collect errors. | 53 * Initialize a newly created error listener to collect errors. |
| 54 */ | 54 */ |
| 55 GatheringErrorListener() : this.con1(null); | 55 GatheringErrorListener() : super(); |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * Initialize a newly created error listener to collect errors. | 58 * Initialize a newly created error listener to collect errors. |
| 59 */ | 59 */ |
| 60 GatheringErrorListener.con1(this._rawSource) { | 60 GatheringErrorListener.con1(String rawSource) { |
| 61 this._markedSource = _rawSource; | 61 this._rawSource = rawSource; |
| 62 this._markedSource = rawSource; |
| 62 } | 63 } |
| 63 | 64 |
| 64 /** | 65 /** |
| 65 * Add all of the errors recorded by the given listener to this listener. | 66 * Add all of the errors recorded by the given listener to this listener. |
| 66 * | 67 * |
| 67 * @param listener the listener that has recorded the errors to be added | 68 * @param listener the listener that has recorded the errors to be added |
| 68 */ | 69 */ |
| 69 void addAll(RecordingErrorListener listener) { | 70 void addAll(RecordingErrorListener listener) { |
| 70 for (AnalysisError error in listener.errors) { | 71 for (AnalysisError error in listener.errors) { |
| 71 onError(error); | 72 onError(error); |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 Source resolveRelative(Uri uri) { | 853 Source resolveRelative(Uri uri) { |
| 853 throw new UnsupportedOperationException(); | 854 throw new UnsupportedOperationException(); |
| 854 } | 855 } |
| 855 UriKind get uriKind { | 856 UriKind get uriKind { |
| 856 throw new UnsupportedOperationException(); | 857 throw new UnsupportedOperationException(); |
| 857 } | 858 } |
| 858 TimestampedData<String> get contents { | 859 TimestampedData<String> get contents { |
| 859 throw new UnsupportedOperationException(); | 860 throw new UnsupportedOperationException(); |
| 860 } | 861 } |
| 861 } | 862 } |
| OLD | NEW |