Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 part of analyzer; | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 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. | |
| 4 | |
|
scheglov
2013/05/09 01:26:46
Missing library directive?
| |
| 5 import 'dart:async'; | |
| 6 import 'dart:io'; | |
| 7 | |
| 8 import 'generated/java_io.dart'; | |
| 9 import 'generated/engine.dart'; | |
| 10 import 'generated/error.dart'; | |
| 11 import 'generated/source_io.dart'; | |
| 12 import 'generated/sdk.dart'; | |
| 13 import 'generated/sdk_io.dart'; | |
| 14 import 'generated/ast.dart'; | |
| 15 import 'generated/element.dart'; | |
| 16 import '../options.dart'; | |
| 2 | 17 |
| 3 /** | 18 /** |
| 4 * Helper for formatting [AnalysisError]s. | 19 * Helper for formatting [AnalysisError]s. |
| 5 * The two format options are a user consumable format and a machine consumable format. | 20 * The two format options are a user consumable format and a machine consumable format. |
| 6 */ | 21 */ |
| 7 class _ErrorFormatter { | 22 class ErrorFormatter { |
| 8 StringSink out; | 23 StringSink out; |
| 9 CommandLineOptions options; | 24 CommandLineOptions options; |
| 10 | 25 |
| 11 _ErrorFormatter(this.out, this.options); | 26 ErrorFormatter(this.out, this.options); |
| 12 | 27 |
| 13 void startAnalysis() { | 28 void startAnalysis() { |
| 14 if (!options.machineFormat) { | 29 if (!options.machineFormat) { |
| 15 out.writeln("Analyzing ${options.sourceFiles}..."); | 30 out.writeln("Analyzing ${options.sourceFiles}..."); |
| 16 } | 31 } |
| 17 } | 32 } |
| 18 | 33 |
| 19 void formatErrors(List<AnalysisErrorInfo> errorInfos) { | 34 void formatErrors(List<AnalysisErrorInfo> errorInfos) { |
| 20 var errors = new List<AnalysisError>(); | 35 var errors = new List<AnalysisError>(); |
| 21 var errorToLine = new Map<AnalysisError, LineInfo>(); | 36 var errorToLine = new Map<AnalysisError, LineInfo>(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 } | 149 } |
| 135 | 150 |
| 136 static String pluralize(String word, int count) { | 151 static String pluralize(String word, int count) { |
| 137 if (count == 1) { | 152 if (count == 1) { |
| 138 return word; | 153 return word; |
| 139 } else { | 154 } else { |
| 140 return word + "s"; | 155 return word + "s"; |
| 141 } | 156 } |
| 142 } | 157 } |
| 143 } | 158 } |
| OLD | NEW |