| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 /// Defines the front-end API for converting source code to Dart Kernel objects. | 5 /// Defines the front-end API for converting source code to Dart Kernel objects. |
| 6 library front_end.kernel_generator; | 6 library front_end.kernel_generator; |
| 7 | 7 |
| 8 import 'compilation_error.dart'; | 8 import 'compilation_error.dart'; |
| 9 import 'compiler_options.dart'; | 9 import 'compiler_options.dart'; |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| 11 | 11 |
| 12 import 'package:analyzer/src/generated/source.dart' show SourceKind; | 12 import 'package:analyzer/src/generated/source.dart' show SourceKind; |
| 13 import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl; | 13 import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl; |
| 14 import 'package:analyzer/src/summary/package_bundle_reader.dart' | 14 import 'package:analyzer/src/summary/package_bundle_reader.dart' |
| 15 show InSummarySource; | 15 show InSummarySource; |
| 16 // TODO(sigmund): move loader logic under front_end/lib/src/kernel/ | 16 // TODO(sigmund): move loader logic under front_end/lib/src/kernel/ |
| 17 import 'package:kernel/analyzer/loader.dart'; | 17 import 'package:analyzer/src/kernel/loader.dart'; |
| 18 import 'package:kernel/kernel.dart'; | 18 import 'package:kernel/kernel.dart'; |
| 19 import 'package:source_span/source_span.dart' show SourceSpan; | 19 import 'package:source_span/source_span.dart' show SourceSpan; |
| 20 | 20 |
| 21 /// Generates a kernel representation of the program whose main library is in | 21 /// Generates a kernel representation of the program whose main library is in |
| 22 /// the given [source]. | 22 /// the given [source]. |
| 23 /// | 23 /// |
| 24 /// Intended for whole program (non-modular) compilation. | 24 /// Intended for whole program (non-modular) compilation. |
| 25 /// | 25 /// |
| 26 /// Given the Uri of a file containing a program's `main` method, this function | 26 /// Given the Uri of a file containing a program's `main` method, this function |
| 27 /// follows `import`, `export`, and `part` declarations to discover the whole | 27 /// follows `import`, `export`, and `part` declarations to discover the whole |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 | 183 |
| 184 // TODO(sigmund): delete this class. Dartk should not format errors itself, we | 184 // TODO(sigmund): delete this class. Dartk should not format errors itself, we |
| 185 // should just pass them along. | 185 // should just pass them along. |
| 186 class _DartkError implements CompilationError { | 186 class _DartkError implements CompilationError { |
| 187 String get correction => null; | 187 String get correction => null; |
| 188 SourceSpan get span => null; | 188 SourceSpan get span => null; |
| 189 final String message; | 189 final String message; |
| 190 _DartkError(this.message); | 190 _DartkError(this.message); |
| 191 } | 191 } |
| OLD | NEW |