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

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

Issue 11938028: Experimental analyzer front-end baby-steps. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
Index: pkg/analyzer-experimental/bin/analyzer.dart
===================================================================
--- pkg/analyzer-experimental/bin/analyzer.dart (revision 0)
+++ pkg/analyzer-experimental/bin/analyzer.dart (revision 0)
@@ -0,0 +1,46 @@
+#!/usr/bin/env dart
+
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/** The entry point for the analyzer */
Bob Nystrom 2013/01/18 22:25:22 Make full sentence: "."
pquitslund 2013/01/22 18:31:53 Done.
+library analyzer;
+
+//import 'dart:async';
+import 'dart:io';
+
+import 'package:analyzer/options.dart';
+
+//Exit status codes
Bob Nystrom 2013/01/18 22:25:22 Space after "//" and "." at the end.
pquitslund 2013/01/22 18:31:53 Done.
+const OK_EXIT = 0;
+const ERROR_EXIT = 1;
+
+void main() {
+ run(new Options().arguments).then((result) {
+ exit(result.error ? ERROR_EXIT : OK_EXIT);
+ });
+}
+
+/** The result of an analysis. */
+class AnalysisResult {
+ final bool error;
+ AnalysisResult.forFailure() : error = true;
+ AnalysisResult.forSuccess() : error = false;
+}
+
+
+/**
+ * Runs the dart analyzer with the command-line options in [args].
+ * See [CommandLineOptions] for a list of valid arguments.
+ */
+Future<AnalysisResult> run(List<String> args) {
+
+ var options = CommandLineOptions.parse(args);
+ if (options == null) {
+ return new Future.immediate(new AnalysisResult.forFailure());
Bob Nystrom 2013/01/18 22:25:22 I would probably separate *analysis* failure from
pquitslund 2013/01/22 18:31:53 Since I've already handled a FormatException in pa
+ }
+
+ //TODO(pquitslund): call out to analyzer...
+
+}
« no previous file with comments | « no previous file | pkg/analyzer-experimental/lib/analyzer.dart » ('j') | pkg/analyzer-experimental/lib/options.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698