Chromium Code Reviews| Index: pkg/analyzer/bin/analyzer.dart |
| diff --git a/pkg/analyzer/bin/analyzer.dart b/pkg/analyzer/bin/analyzer.dart |
| index 9079b8290cad005884e7277adabda0ccedcef7d8..39b985daefaf836251e420224027ec0457540854 100644 |
| --- a/pkg/analyzer/bin/analyzer.dart |
| +++ b/pkg/analyzer/bin/analyzer.dart |
| @@ -22,14 +22,14 @@ void main(args) { |
| if (options.shouldBatch) { |
| BatchRunner.runAsBatch(args, (List<String> args) { |
| CommandLineOptions options = CommandLineOptions.parse(args); |
| - _runAnalyzer(options); |
| + return _runAnalyzer(options, false); |
|
Brian Wilkerson
2014/03/14 18:31:17
I'm not sure why you added return statements to th
jwren
2014/03/14 19:05:37
The return type is required to be ErrorSeverity on
|
| }); |
| } else { |
| - _runAnalyzer(options); |
| + return _runAnalyzer(options); |
| } |
| } |
| -void _runAnalyzer(CommandLineOptions options) { |
| +dynamic _runAnalyzer(CommandLineOptions options, [bool async = true]) { |
|
scheglov
2014/03/14 18:25:33
You could remove the return type, it is dynamic by
Brian Wilkerson
2014/03/14 18:31:17
Is this method used outside of 'main'? If not, and
jwren
2014/03/14 19:05:37
This method is being called indirectly below, see
|
| int startTime = JavaSystem.currentTimeMillis(); |
| if (!options.machineFormat) { |
| stdout.writeln("Analyzing ${options.sourceFiles}..."); |
| @@ -41,17 +41,21 @@ void _runAnalyzer(CommandLineOptions options) { |
| if (!new File(sourcePath).existsSync()) { |
| print('File not found: $sourcePath'); |
| exitCode = ErrorSeverity.ERROR.ordinal; |
| - return; |
| + return ErrorSeverity.ERROR; |
| } |
| // check that file is Dart file |
| if (!AnalysisEngine.isDartFileName(sourcePath)) { |
| print('$sourcePath is not a Dart file'); |
| exitCode = ErrorSeverity.ERROR.ordinal; |
| - return; |
| + return ErrorSeverity.ERROR; |
| } |
| // do analyze |
| AnalyzerImpl analyzer = new AnalyzerImpl(sourcePath, options, startTime); |
| - analyzer.analyze(); |
| + if (async) { |
| + return analyzer.analyzeAsync(); |
| + } else { |
| + return analyzer.analyzeSync(); |
| + } |
| } |
| typedef ErrorSeverity BatchRunnerHandler(List<String> args); |