| 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 /// An entrypoint used to run portions of front_end and measure its performance. | 5 /// An entrypoint used to run portions of front_end and measure its performance. |
| 6 library front_end.tool.perf; | 6 library front_end.tool.perf; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:io' show Directory, File, Platform, exit; | 9 import 'dart:io' show Directory, File, Platform, exit; |
| 10 | 10 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 | 196 |
| 197 void _reportErrors(List errors, ErrorHandler onError) { | 197 void _reportErrors(List errors, ErrorHandler onError) { |
| 198 if (onError == null) return; | 198 if (onError == null) return; |
| 199 for (var error in errors) { | 199 for (var error in errors) { |
| 200 onError(new _DartkError(error)); | 200 onError(new _DartkError(error)); |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 class _DartkError implements CompilationError { | 204 class _DartkError implements CompilationError { |
| 205 String get correction => null; | 205 String get tip => null; |
| 206 SourceSpan get span => null; | 206 SourceSpan get span => null; |
| 207 final String message; | 207 final String message; |
| 208 _DartkError(this.message); | 208 _DartkError(this.message); |
| 209 } | 209 } |
| 210 | 210 |
| 211 /// Generates unlinkmed summaries for all files in [files], and returns them in | 211 /// Generates unlinkmed summaries for all files in [files], and returns them in |
| 212 /// an [_UnlinkedSummaries] container. | 212 /// an [_UnlinkedSummaries] container. |
| 213 _UnlinkedSummaries generateUnlinkedSummaries(Set<Source> files) { | 213 _UnlinkedSummaries generateUnlinkedSummaries(Set<Source> files) { |
| 214 var unlinkedSummaries = new _UnlinkedSummaries(); | 214 var unlinkedSummaries = new _UnlinkedSummaries(); |
| 215 for (var source in files) { | 215 for (var source in files) { |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 class _Scanner extends Scanner { | 431 class _Scanner extends Scanner { |
| 432 _Scanner(String contents) : super.create(new CharSequenceReader(contents)) { | 432 _Scanner(String contents) : super.create(new CharSequenceReader(contents)) { |
| 433 preserveComments = false; | 433 preserveComments = false; |
| 434 } | 434 } |
| 435 | 435 |
| 436 @override | 436 @override |
| 437 void reportError(errorCode, int offset, List<Object> arguments) { | 437 void reportError(errorCode, int offset, List<Object> arguments) { |
| 438 // ignore errors. | 438 // ignore errors. |
| 439 } | 439 } |
| 440 } | 440 } |
| OLD | NEW |