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