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 | 7 import 'dart:async' show |
8 Future; | 8 Future; |
9 | 9 |
10 import 'dart:collection' show | 10 import 'dart:collection' show |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // TODO(ahe): Share this message with [buildBodies]. Also make it easy to | 123 // TODO(ahe): Share this message with [buildBodies]. Also make it easy to |
124 // tell the difference between outlines read from a dill file or source | 124 // tell the difference between outlines read from a dill file or source |
125 // files. Currently, [libraryCount] is wrong for dill files. | 125 // files. Currently, [libraryCount] is wrong for dill files. |
126 print(""" | 126 print(""" |
127 $sinceStart: $message ($byteCount bytes) in ${format(ms, 3, 0)}ms, that is, | 127 $sinceStart: $message ($byteCount bytes) in ${format(ms, 3, 0)}ms, that is, |
128 ${format(byteCount / ms, 3, 12)} bytes/ms, and | 128 ${format(byteCount / ms, 3, 12)} bytes/ms, and |
129 ${format(ms / libraryCount, 3, 12)} ms/compilation unit."""); | 129 ${format(ms / libraryCount, 3, 12)} ms/compilation unit."""); |
130 }); | 130 }); |
131 } | 131 } |
132 | 132 |
133 Future<Null> buildOutline(LibraryBuilder library); | 133 Future<Null> buildOutline(covariant LibraryBuilder library); |
134 | 134 |
135 Future<Null> buildBody(LibraryBuilder library, AstKind astKind); | 135 Future<Null> buildBody(covariant LibraryBuilder library, AstKind astKind); |
136 | 136 |
137 List<InputError> collectCompileTimeErrors() { | 137 List<InputError> collectCompileTimeErrors() { |
138 List<InputError> errors = <InputError>[]; | 138 List<InputError> errors = <InputError>[]; |
139 for (LibraryBuilder library in builders.values) { | 139 for (LibraryBuilder library in builders.values) { |
140 if (library.loader == this) { | 140 if (library.loader == this) { |
141 errors.addAll(library.compileTimeErrors); | 141 errors.addAll(library.compileTimeErrors); |
142 } | 142 } |
143 } | 143 } |
144 return errors; | 144 return errors; |
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 |