OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /// Defines the front-end API for converting source code to Dart Kernel objects. |
| 6 library front_end.kernel_generator; |
| 7 |
| 8 import 'dart:async'; |
| 9 import 'options.dart'; |
| 10 import 'package:kernel/kernel.dart' as kernel; |
| 11 |
| 12 /// Processes the program whose main library is in the given [source]. |
| 13 /// |
| 14 /// Intended for whole program (non-modular) compilation. |
| 15 /// |
| 16 /// Given the Uri of a file containing a program's `main` method, this function |
| 17 /// follows `import`, `export`, and `part` declarations to discover the whole |
| 18 /// program, and converts the result to Dart Kernel format. |
| 19 /// |
| 20 /// If summaries are provided in [options], they may be used to speed up |
| 21 /// analysis, but they will not take the place of Dart source code (since the |
| 22 /// Dart source code is still needed to access the contents of method bodies). |
| 23 Future<kernel.Program> compileProgram(Options options, Uri source) => |
| 24 throw new UnimplementedError(); |
| 25 |
| 26 /// Processes the build unit whose source files are in [sources]. |
| 27 /// |
| 28 /// Intended for modular compilation. |
| 29 /// |
| 30 /// [sources] should be the complete set of source files for a build unit |
| 31 /// (including both library and part files). All of the library files are |
| 32 /// compiled to Dart Kernel objects. |
| 33 /// |
| 34 /// The compilation process is hermetic, meaning that the only files which will |
| 35 /// be read are those listed in [sources], [Options.inputSummaries], and |
| 36 /// [Options.sdkSummary]. If a source file attempts to refer to a file which is |
| 37 /// not obtainable from these paths, that will result in an error, even if the |
| 38 /// file exists on the filesystem. |
| 39 /// |
| 40 /// Any `part` declarations found in [sources] must refer to part files which |
| 41 /// are also listed in [sources], otherwise an error results. (It is not |
| 42 /// permitted to refer to a part file declared in another build unit). |
| 43 /// |
| 44 /// The return value is a [kernel.Program] object with no main method set. |
| 45 /// |
| 46 /// TODO(paulberry): does additional information need to be output to allow the |
| 47 /// caller to match up referenced elements to the summary files they were |
| 48 /// obtained from? |
| 49 Future<kernel.Program> compileBuildUnit(Options options, List<Uri> sources) => |
| 50 throw new UnimplementedError(); |
OLD | NEW |