OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.loader; | 5 library fasta.loader; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:collection' show Queue; | 9 import 'dart:collection' show Queue; |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 LibraryBuilder first; | 30 LibraryBuilder first; |
31 | 31 |
32 int byteCount = 0; | 32 int byteCount = 0; |
33 | 33 |
34 Uri currentUriForCrashReporting; | 34 Uri currentUriForCrashReporting; |
35 | 35 |
36 Loader(this.target); | 36 Loader(this.target); |
37 | 37 |
38 Ticker get ticker => target.ticker; | 38 Ticker get ticker => target.ticker; |
39 | 39 |
40 /// Look up a library builder by the the name [uri], or if such doesn't | 40 /// Look up a library builder by the name [uri], or if such doesn't |
41 /// exist, create one. The canonical URI of the library is [uri], and its | 41 /// exist, create one. The canonical URI of the library is [uri], and its |
42 /// actual location is [fileUri]. | 42 /// actual location is [fileUri]. |
43 /// | 43 /// |
44 /// Canonical URIs have schemes like "dart", or "package", and the actual | 44 /// Canonical URIs have schemes like "dart", or "package", and the actual |
45 /// location is often a file URI. | 45 /// location is often a file URI. |
46 LibraryBuilder read(Uri uri, [Uri fileUri]) { | 46 LibraryBuilder read(Uri uri, [Uri fileUri]) { |
47 firstSourceUri ??= uri; | 47 firstSourceUri ??= uri; |
48 LibraryBuilder builder = builders.putIfAbsent(uri, () { | 48 LibraryBuilder builder = builders.putIfAbsent(uri, () { |
49 if (fileUri == null) { | 49 if (fileUri == null) { |
50 switch (uri.scheme) { | 50 switch (uri.scheme) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 Builder getNativeAnnotation() => target.getNativeAnnotation(this); | 141 Builder getNativeAnnotation() => target.getNativeAnnotation(this); |
142 | 142 |
143 Builder getAbstractClassInstantiationError() { | 143 Builder getAbstractClassInstantiationError() { |
144 return target.getAbstractClassInstantiationError(this); | 144 return target.getAbstractClassInstantiationError(this); |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 String format(double d, int fractionDigits, int width) { | 148 String format(double d, int fractionDigits, int width) { |
149 return d.toStringAsFixed(fractionDigits).padLeft(width); | 149 return d.toStringAsFixed(fractionDigits).padLeft(width); |
150 } | 150 } |
OLD | NEW |