| 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/src/error.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; |
| 11 import 'package:analyzer/src/generated/error.dart'; |
| 12 import 'package:analyzer/src/generated/parser.dart'; |
| 13 import 'package:analyzer/src/generated/scanner.dart'; |
| 14 import 'package:analyzer/src/generated/source_io.dart'; |
| 15 import 'package:analyzer/src/string_source.dart'; |
| 9 import 'package:path/path.dart' as pathos; | 16 import 'package:path/path.dart' as pathos; |
| 10 | 17 |
| 11 import 'src/error.dart'; | 18 export 'package:analyzer/src/error.dart'; |
| 12 import 'src/generated/ast.dart'; | 19 export 'package:analyzer/src/generated/ast.dart'; |
| 13 import 'src/generated/error.dart'; | 20 export 'package:analyzer/src/generated/error.dart'; |
| 14 import 'src/generated/parser.dart'; | 21 export 'package:analyzer/src/generated/utilities_dart.dart'; |
| 15 import 'src/generated/scanner.dart'; | |
| 16 import 'src/generated/source_io.dart'; | |
| 17 import 'src/string_source.dart'; | |
| 18 | |
| 19 export 'src/error.dart'; | |
| 20 export 'src/generated/ast.dart'; | |
| 21 export 'src/generated/error.dart'; | |
| 22 export 'src/generated/utilities_dart.dart'; | |
| 23 | 22 |
| 24 /// Parses a string of Dart code into an AST. | 23 /// Parses a string of Dart code into an AST. |
| 25 /// | 24 /// |
| 26 /// If [name] is passed, it's used in error messages as the name of the code | 25 /// If [name] is passed, it's used in error messages as the name of the code |
| 27 /// being parsed. | 26 /// being parsed. |
| 28 /// | 27 /// |
| 29 /// Throws an [AnalyzerErrorGroup] if any errors occurred, unless | 28 /// Throws an [AnalyzerErrorGroup] if any errors occurred, unless |
| 30 /// [suppressErrors] is `true`, in which case any errors are discarded. | 29 /// [suppressErrors] is `true`, in which case any errors are discarded. |
| 31 /// | 30 /// |
| 32 /// If [parseFunctionBodies] is [false] then only function signatures will be | 31 /// If [parseFunctionBodies] is [false] then only function signatures will be |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 119 |
| 121 /// The group of errors collected. | 120 /// The group of errors collected. |
| 122 AnalyzerErrorGroup get group => | 121 AnalyzerErrorGroup get group => |
| 123 new AnalyzerErrorGroup.fromAnalysisErrors(_errors); | 122 new AnalyzerErrorGroup.fromAnalysisErrors(_errors); |
| 124 | 123 |
| 125 /// Whether any errors where collected. | 124 /// Whether any errors where collected. |
| 126 bool get hasErrors => !_errors.isEmpty; | 125 bool get hasErrors => !_errors.isEmpty; |
| 127 | 126 |
| 128 void onError(AnalysisError error) => _errors.add(error); | 127 void onError(AnalysisError error) => _errors.add(error); |
| 129 } | 128 } |
| OLD | NEW |