Chromium Code Reviews| 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 'dart:uri'; | 8 import 'dart:uri'; |
| 9 import 'implementation/apiimpl.dart'; | 9 import 'implementation/apiimpl.dart'; |
| 10 | 10 |
| 11 // Unless explicitly allowed, passing [:null:] for any argument to the | 11 // Unless explicitly allowed, passing [:null:] for any argument to the |
| 12 // methods of library will result in an Error being thrown. | 12 // methods of library will result in an Error being thrown. |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * Returns a future that completes to the source corresponding to | 15 * Returns a future that completes to the source corresponding to |
| 16 * [uri]. If an exception occurs, the future completes with this | 16 * [uri]. If an exception occurs, the future completes with this |
| 17 * exception. | 17 * exception. |
| 18 */ | 18 */ |
| 19 typedef Future<String> CompilerInputProvider(Uri uri); | 19 typedef Future<String> CompilerInputProvider(Uri uri); |
| 20 | 20 |
| 21 /// Deprecated, please use [CompilerInputProvider] instead. | 21 /// Deprecated, please use [CompilerInputProvider] instead. |
| 22 typedef Future<String> ReadStringFromUri(Uri uri); | 22 typedef Future<String> ReadStringFromUri(Uri uri); |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * Returns a [StreamSink] that will serve as compiler output for the given | 25 * Returns a [EventSink] that will serve as compiler output for the given |
|
ngeoffray
2013/03/08 10:27:12
a -> an
Lasse Reichstein Nielsen
2013/03/08 11:22:37
Done.
| |
| 26 * component. | 26 * component. |
| 27 * | 27 * |
| 28 * Components are identified by [name] and [extension]. By convention, | 28 * Components are identified by [name] and [extension]. By convention, |
| 29 * the empty string [:"":] will represent the main script | 29 * the empty string [:"":] will represent the main script |
| 30 * (corresponding to the script parameter of [compile]) even if the | 30 * (corresponding to the script parameter of [compile]) even if the |
| 31 * main script is a library. For libraries that are compiled | 31 * main script is a library. For libraries that are compiled |
| 32 * separately, the library name is used. | 32 * separately, the library name is used. |
| 33 * | 33 * |
| 34 * At least the following extensions can be expected: | 34 * At least the following extensions can be expected: |
| 35 * | 35 * |
| 36 * * "js" for JavaScript output. | 36 * * "js" for JavaScript output. |
| 37 * * "js.map" for source maps. | 37 * * "js.map" for source maps. |
| 38 * * "dart" for Dart output. | 38 * * "dart" for Dart output. |
| 39 * * "dart.map" for source maps. | 39 * * "dart.map" for source maps. |
| 40 * | 40 * |
| 41 * As more features are added to the compiler, new names and | 41 * As more features are added to the compiler, new names and |
| 42 * extensions may be introduced. | 42 * extensions may be introduced. |
| 43 */ | 43 */ |
| 44 typedef StreamSink<String> CompilerOutputProvider(String name, | 44 typedef EventSink<String> CompilerOutputProvider(String name, |
| 45 String extension); | 45 String extension); |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Invoked by the compiler to report diagnostics. If [uri] is | 48 * Invoked by the compiler to report diagnostics. If [uri] is |
| 49 * [:null:], so are [begin] and [end]. No other arguments may be | 49 * [:null:], so are [begin] and [end]. No other arguments may be |
| 50 * [:null:]. If [uri] is not [:null:], neither are [begin] and | 50 * [:null:]. If [uri] is not [:null:], neither are [begin] and |
| 51 * [end]. [uri] indicates the compilation unit from where the | 51 * [end]. [uri] indicates the compilation unit from where the |
| 52 * diagnostic originates. [begin] and [end] are zero-based character | 52 * diagnostic originates. [begin] and [end] are zero-based character |
| 53 * offsets from the beginning of the compilaton unit. [message] is the | 53 * offsets from the beginning of the compilaton unit. [message] is the |
| 54 * diagnostic message, and [kind] indicates indicates what kind of | 54 * diagnostic message, and [kind] indicates indicates what kind of |
| 55 * diagnostic it is. | 55 * diagnostic it is. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 final String name; | 168 final String name; |
| 169 | 169 |
| 170 /** | 170 /** |
| 171 * This constructor is not private to support user-defined | 171 * This constructor is not private to support user-defined |
| 172 * diagnostic kinds. | 172 * diagnostic kinds. |
| 173 */ | 173 */ |
| 174 const Diagnostic(this.ordinal, this.name); | 174 const Diagnostic(this.ordinal, this.name); |
| 175 | 175 |
| 176 String toString() => name; | 176 String toString() => name; |
| 177 } | 177 } |
| OLD | NEW |