| 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 'implementation/apiimpl.dart'; | 8 import 'implementation/apiimpl.dart'; |
| 9 | 9 |
| 10 // Unless explicitly allowed, passing [:null:] for any argument to the | 10 // Unless explicitly allowed, passing [:null:] for any argument to the |
| 11 // methods of library will result in an Error being thrown. | 11 // methods of library will result in an Error being thrown. |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Returns a future that completes to the source corresponding to | 14 * Returns a future that completes to the source corresponding to [uri]. |
| 15 * [uri]. If an exception occurs, the future completes with this | 15 * If an exception occurs, the future completes with this exception. |
| 16 * exception. | 16 * |
| 17 * The source can be represented either as a [:List<int>:] of UTF-8 bytes or as |
| 18 * a [String]. |
| 19 * |
| 20 * The following text is non-normative: |
| 21 * |
| 22 * It is recommended to return a UTF-8 encoded list of bytes because the scanner |
| 23 * is more efficient in this case. In either case, the data structure is |
| 24 * expected to hold a zero element at the last position. If this is not the |
| 25 * case, the entire data structure is copied before scanning. |
| 17 */ | 26 */ |
| 18 typedef Future<String> CompilerInputProvider(Uri uri); | 27 typedef Future/*<String | List<int>>*/ CompilerInputProvider(Uri uri); |
| 19 | 28 |
| 20 /// Deprecated, please use [CompilerInputProvider] instead. | 29 /// Deprecated, please use [CompilerInputProvider] instead. |
| 21 typedef Future<String> ReadStringFromUri(Uri uri); | 30 typedef Future<String> ReadStringFromUri(Uri uri); |
| 22 | 31 |
| 23 /** | 32 /** |
| 24 * Returns an [EventSink] that will serve as compiler output for the given | 33 * Returns an [EventSink] that will serve as compiler output for the given |
| 25 * component. | 34 * component. |
| 26 * | 35 * |
| 27 * Components are identified by [name] and [extension]. By convention, | 36 * Components are identified by [name] and [extension]. By convention, |
| 28 * the empty string [:"":] will represent the main script | 37 * the empty string [:"":] will represent the main script |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 final String name; | 183 final String name; |
| 175 | 184 |
| 176 /** | 185 /** |
| 177 * This constructor is not private to support user-defined | 186 * This constructor is not private to support user-defined |
| 178 * diagnostic kinds. | 187 * diagnostic kinds. |
| 179 */ | 188 */ |
| 180 const Diagnostic(this.ordinal, this.name); | 189 const Diagnostic(this.ordinal, this.name); |
| 181 | 190 |
| 182 String toString() => name; | 191 String toString() => name; |
| 183 } | 192 } |
| OLD | NEW |