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

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
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:io' show
8 Platform;
9
10 import 'package:dart2js_incremental/dart2js_incremental.dart' show
11 reuseCompiler;
12
13 import 'package:compiler/implementation/source_file_provider.dart' show
14 FormattingDiagnosticHandler,
15 SourceFileProvider;
16
17 import 'package:compiler/compiler.dart' as api show
18 Diagnostic;
19
20 void main(List<String> arguments) {
21 Uri script = Uri.base.resolve(arguments.first);
22 int position = int.parse(arguments[1]);
23 FormattingDiagnosticHandler handler = new FormattingDiagnosticHandler();
24 handler
25 ..verbose = true
26 ..enableColors = true;
27
28 Uri libraryRoot = Uri.base.resolve('sdk/');
29 Uri packageRoot = Uri.base.resolveUri(
30 new Uri.file('${Platform.packageRoot}/'));
31
32 var options = [
33 '--analyze-main',
34 '--analyze-only',
35 '--no-source-maps',
36 '--verbose',
37 '--categories=Client,Server',
38 ];
39
40 var cachedCompiler = null;
41 cachedCompiler = reuseCompiler(
42 diagnosticHandler: handler,
43 inputProvider: handler.provider,
44 options: options,
45 cachedCompiler: cachedCompiler,
46 libraryRoot: libraryRoot,
47 packageRoot: packageRoot,
48 packagesAreImmutable: true);
49
50 cachedCompiler.run(script).then((success) {
51 if (success != true) {
52 throw 'Compilation failed';
53 }
54 handler(
55 script, position, position + 1,
56 'Point of interest.', api.Diagnostic.HINT);
57 });
58 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/memory_compiler.dart » ('j') | dart/tests/compiler/dart2js/memory_compiler.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698