| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// New Compiler API. This API is under construction, use only internally or | 5 /// New Compiler API. This API is under construction, use only internally or |
| 6 /// in unittests. | 6 /// in unittests. |
| 7 | 7 |
| 8 library compiler_new; | 8 library compiler_new; |
| 9 | 9 |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 /// scanner is more efficient in this case. In either case, the data structure | 32 /// scanner is more efficient in this case. In either case, the data structure |
| 33 /// is expected to hold a zero element at the last position. If this is not | 33 /// is expected to hold a zero element at the last position. If this is not |
| 34 /// the case, the entire data structure is copied before scanning. | 34 /// the case, the entire data structure is copied before scanning. |
| 35 Future/*<String | List<int>>*/ readFromUri(Uri uri); | 35 Future/*<String | List<int>>*/ readFromUri(Uri uri); |
| 36 } | 36 } |
| 37 | 37 |
| 38 /// Interface for producing output from the compiler. That is, JavaScript target | 38 /// Interface for producing output from the compiler. That is, JavaScript target |
| 39 /// files, source map files, dump info files, etc. | 39 /// files, source map files, dump info files, etc. |
| 40 abstract class CompilerOutput { | 40 abstract class CompilerOutput { |
| 41 /// Returns an [EventSink] that will serve as compiler output for the given | 41 /// Returns an [EventSink] that will serve as compiler output for the given |
| 42 /// component. | 42 /// component. |
| 43 /// | 43 /// |
| 44 /// Components are identified by [name] and [extension]. By convention, | 44 /// Components are identified by [name] and [extension]. By convention, |
| 45 /// the empty string [:"":] will represent the main script | 45 /// the empty string [:"":] will represent the main script |
| 46 /// (corresponding to the script parameter of [compile]) even if the | 46 /// (corresponding to the script parameter of [compile]) even if the |
| 47 /// main script is a library. For libraries that are compiled | 47 /// main script is a library. For libraries that are compiled |
| 48 /// separately, the library name is used. | 48 /// separately, the library name is used. |
| 49 /// | 49 /// |
| 50 /// At least the following extensions can be expected: | 50 /// At least the following extensions can be expected: |
| 51 /// | 51 /// |
| 52 /// * "js" for JavaScript output. | 52 /// * "js" for JavaScript output. |
| 53 /// * "js.map" for source maps. | 53 /// * "js.map" for source maps. |
| 54 /// * "dart" for Dart output. | 54 /// * "dart" for Dart output. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 if (compilerOutput == null) { | 118 if (compilerOutput == null) { |
| 119 throw new ArgumentError("compilerOutput must be non-null"); | 119 throw new ArgumentError("compilerOutput must be non-null"); |
| 120 } | 120 } |
| 121 | 121 |
| 122 CompilerImpl compiler = new CompilerImpl( | 122 CompilerImpl compiler = new CompilerImpl( |
| 123 compilerInput, compilerOutput, compilerDiagnostics, compilerOptions); | 123 compilerInput, compilerOutput, compilerDiagnostics, compilerOptions); |
| 124 return compiler.run(compilerOptions.entryPoint).then((bool success) { | 124 return compiler.run(compilerOptions.entryPoint).then((bool success) { |
| 125 return new CompilationResult(compiler, isSuccess: success); | 125 return new CompilationResult(compiler, isSuccess: success); |
| 126 }); | 126 }); |
| 127 } | 127 } |
| OLD | NEW |