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

Side by Side Diff: dart/site/try/poi/poi.dart

Issue 386563002: Add "point of interest" app for command-line testing of dart2js type information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, 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
5 library trydart.poi;
6
7 import 'dart:async' show
8 Future;
9
10 import 'dart:io' show
11 Platform;
12
13 import 'package:dart2js_incremental/dart2js_incremental.dart' show
14 reuseCompiler;
15
16 import 'package:compiler/implementation/source_file_provider.dart' show
17 FormattingDiagnosticHandler,
18 SourceFileProvider;
19
20 import 'package:compiler/compiler.dart' as api show
21 Diagnostic;
22
23 Future doneFuture;
24
25 void main(List<String> arguments) {
26 Uri script = Uri.base.resolve(arguments.first);
27 int position = int.parse(arguments[1]);
28 FormattingDiagnosticHandler handler = new FormattingDiagnosticHandler();
29 handler
30 ..verbose = true
31 ..enableColors = true;
32
33 Uri libraryRoot = Uri.base.resolve('sdk/');
34 Uri packageRoot = Uri.base.resolveUri(
35 new Uri.file('${Platform.packageRoot}/'));
36
37 var options = [
38 '--analyze-main',
39 '--analyze-only',
40 '--no-source-maps',
41 '--verbose',
42 '--categories=Client,Server',
43 ];
44
45 var cachedCompiler = null;
46 cachedCompiler = reuseCompiler(
47 diagnosticHandler: handler,
48 inputProvider: handler.provider,
49 options: options,
50 cachedCompiler: cachedCompiler,
51 libraryRoot: libraryRoot,
52 packageRoot: packageRoot,
53 packagesAreImmutable: true);
54
55 doneFuture = cachedCompiler.run(script).then((success) {
56 if (success != true) {
57 throw 'Compilation failed';
58 }
59 handler(
60 script, position, position + 1,
61 'Point of interest.', api.Diagnostic.HINT);
62 });
63 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698