OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library analyzer; | 5 library analyzer; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/error/error.dart'; |
| 11 import 'package:analyzer/error/listener.dart'; |
| 12 import 'package:analyzer/file_system/file_system.dart' hide File; |
| 13 import 'package:analyzer/file_system/physical_file_system.dart'; |
10 import 'package:analyzer/src/dart/scanner/reader.dart'; | 14 import 'package:analyzer/src/dart/scanner/reader.dart'; |
11 import 'package:analyzer/src/dart/scanner/scanner.dart'; | 15 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
12 import 'package:analyzer/src/error.dart'; | 16 import 'package:analyzer/src/error.dart'; |
13 import 'package:analyzer/src/generated/error.dart'; | |
14 import 'package:analyzer/src/generated/parser.dart'; | 17 import 'package:analyzer/src/generated/parser.dart'; |
15 import 'package:analyzer/src/generated/source_io.dart'; | 18 import 'package:analyzer/src/generated/source_io.dart'; |
16 import 'package:analyzer/src/string_source.dart'; | 19 import 'package:analyzer/src/string_source.dart'; |
17 import 'package:analyzer/file_system/file_system.dart' hide File; | |
18 import 'package:analyzer/file_system/physical_file_system.dart'; | |
19 import 'package:path/path.dart' as pathos; | 20 import 'package:path/path.dart' as pathos; |
20 | 21 |
21 export 'package:analyzer/dart/ast/ast.dart'; | 22 export 'package:analyzer/dart/ast/ast.dart'; |
22 export 'package:analyzer/dart/ast/visitor.dart'; | 23 export 'package:analyzer/dart/ast/visitor.dart'; |
| 24 export 'package:analyzer/error/error.dart'; |
| 25 export 'package:analyzer/error/listener.dart'; |
23 export 'package:analyzer/src/dart/ast/utilities.dart'; | 26 export 'package:analyzer/src/dart/ast/utilities.dart'; |
24 export 'package:analyzer/src/error.dart'; | 27 export 'package:analyzer/src/error.dart'; |
25 export 'package:analyzer/src/generated/error.dart'; | 28 export 'package:analyzer/src/error/codes.dart'; |
26 export 'package:analyzer/src/generated/utilities_dart.dart'; | 29 export 'package:analyzer/src/generated/utilities_dart.dart'; |
27 | 30 |
28 /// Parses a string of Dart code into an AST. | 31 /// Parses a string of Dart code into an AST. |
29 /// | 32 /// |
30 /// If [name] is passed, it's used in error messages as the name of the code | 33 /// If [name] is passed, it's used in error messages as the name of the code |
31 /// being parsed. | 34 /// being parsed. |
32 /// | 35 /// |
33 /// Throws an [AnalyzerErrorGroup] if any errors occurred, unless | 36 /// Throws an [AnalyzerErrorGroup] if any errors occurred, unless |
34 /// [suppressErrors] is `true`, in which case any errors are discarded. | 37 /// [suppressErrors] is `true`, in which case any errors are discarded. |
35 /// | 38 /// |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 /// The group of errors collected. | 127 /// The group of errors collected. |
125 AnalyzerErrorGroup get group => | 128 AnalyzerErrorGroup get group => |
126 new AnalyzerErrorGroup.fromAnalysisErrors(_errors); | 129 new AnalyzerErrorGroup.fromAnalysisErrors(_errors); |
127 | 130 |
128 /// Whether any errors where collected. | 131 /// Whether any errors where collected. |
129 bool get hasErrors => !_errors.isEmpty; | 132 bool get hasErrors => !_errors.isEmpty; |
130 | 133 |
131 @override | 134 @override |
132 void onError(AnalysisError error) => _errors.add(error); | 135 void onError(AnalysisError error) => _errors.add(error); |
133 } | 136 } |
OLD | NEW |