Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: pkg/analyzer/bin/analyzer.dart

Issue 200523003: Restore batch mode in the Dart-based Dart analyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nit: improve documentation Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/analyzer_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/analyzer_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698