OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 compiler; | 5 library compiler; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:package_config/packages.dart'; | 8 import 'package:package_config/packages.dart'; |
9 import 'compiler_new.dart' as new_api; | 9 import 'compiler_new.dart' as new_api; |
| 10 import 'src/options.dart' show CompilerOptions; |
10 import 'src/old_to_new_api.dart'; | 11 import 'src/old_to_new_api.dart'; |
11 | 12 |
12 // Unless explicitly allowed, passing [:null:] for any argument to the | 13 // Unless explicitly allowed, passing [:null:] for any argument to the |
13 // methods of library will result in an Error being thrown. | 14 // methods of library will result in an Error being thrown. |
14 | 15 |
15 /** | 16 /** |
16 * Returns a future that completes to the source corresponding to [uri]. | 17 * Returns a future that completes to the source corresponding to [uri]. |
17 * If an exception occurs, the future completes with this exception. | 18 * If an exception occurs, the future completes with this exception. |
18 * | 19 * |
19 * The source can be represented either as a [:List<int>:] of UTF-8 bytes or as | 20 * The source can be represented either as a [:List<int>:] of UTF-8 bytes or as |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 Uri libraryRoot, | 109 Uri libraryRoot, |
109 Uri packageRoot, | 110 Uri packageRoot, |
110 CompilerInputProvider inputProvider, | 111 CompilerInputProvider inputProvider, |
111 DiagnosticHandler handler, | 112 DiagnosticHandler handler, |
112 [List<String> options = const [], | 113 [List<String> options = const [], |
113 CompilerOutputProvider outputProvider, | 114 CompilerOutputProvider outputProvider, |
114 Map<String, dynamic> environment = const {}, | 115 Map<String, dynamic> environment = const {}, |
115 Uri packageConfig, | 116 Uri packageConfig, |
116 PackagesDiscoveryProvider packagesDiscoveryProvider]) { | 117 PackagesDiscoveryProvider packagesDiscoveryProvider]) { |
117 | 118 |
118 new_api.CompilerOptions compilerOptions = new new_api.CompilerOptions.parse( | 119 CompilerOptions compilerOptions = new CompilerOptions.parse( |
119 entryPoint: script, | 120 entryPoint: script, |
120 libraryRoot: libraryRoot, | 121 libraryRoot: libraryRoot, |
121 packageRoot: packageRoot, | 122 packageRoot: packageRoot, |
122 packageConfig: packageConfig, | 123 packageConfig: packageConfig, |
123 packagesDiscoveryProvider: packagesDiscoveryProvider, | 124 packagesDiscoveryProvider: packagesDiscoveryProvider, |
124 options: options, | 125 options: options, |
125 environment: environment); | 126 environment: environment); |
126 | 127 |
127 new_api.CompilerInput compilerInput = new LegacyCompilerInput(inputProvider); | 128 new_api.CompilerInput compilerInput = new LegacyCompilerInput(inputProvider); |
128 new_api.CompilerDiagnostics compilerDiagnostics = | 129 new_api.CompilerDiagnostics compilerDiagnostics = |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 final String name; | 203 final String name; |
203 | 204 |
204 /** | 205 /** |
205 * This constructor is not private to support user-defined | 206 * This constructor is not private to support user-defined |
206 * diagnostic kinds. | 207 * diagnostic kinds. |
207 */ | 208 */ |
208 const Diagnostic(this.ordinal, this.name); | 209 const Diagnostic(this.ordinal, this.name); |
209 | 210 |
210 String toString() => name; | 211 String toString() => name; |
211 } | 212 } |
OLD | NEW |