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

Side by Side Diff: pkg/analyzer_experimental/example/resolver_driver.dart

Issue 13095014: Tweak Resolver driver sample to prevent warning from new analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 2
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 import 'package:analyzer_experimental/src/generated/java_io.dart'; 7 import 'package:analyzer_experimental/src/generated/java_io.dart';
8 import 'package:analyzer_experimental/src/generated/source_io.dart'; 8 import 'package:analyzer_experimental/src/generated/source_io.dart';
9 import 'package:analyzer_experimental/src/generated/ast.dart'; 9 import 'package:analyzer_experimental/src/generated/ast.dart';
10 import 'package:analyzer_experimental/src/generated/sdk.dart'; 10 import 'package:analyzer_experimental/src/generated/sdk.dart';
(...skipping 26 matching lines...) Expand all
37 37
38 CompilationUnit resolvedUnit = context.resolveCompilationUnit(source, libEleme nt); 38 CompilationUnit resolvedUnit = context.resolveCompilationUnit(source, libEleme nt);
39 var visitor = new _ASTVisitor(); 39 var visitor = new _ASTVisitor();
40 resolvedUnit.accept(visitor); 40 resolvedUnit.accept(visitor);
41 } 41 }
42 42
43 class _ASTVisitor extends GeneralizingASTVisitor { 43 class _ASTVisitor extends GeneralizingASTVisitor {
44 visitNode(ASTNode node) { 44 visitNode(ASTNode node) {
45 String text = '${node.runtimeType} : <"${node.toString()}">'; 45 String text = '${node.runtimeType} : <"${node.toString()}">';
46 if (node is SimpleIdentifier) { 46 if (node is SimpleIdentifier) {
47 Element element = node.element; 47 Element element = (node as SimpleIdentifier).element;
48 if (element != null) { 48 if (element != null) {
49 text += " element: ${element.runtimeType}"; 49 text += " element: ${element.runtimeType}";
50 LibraryElement library = element.library; 50 LibraryElement library = element.library;
51 if (library != null) { 51 if (library != null) {
52 text += " from ${element.library.definingCompilationUnit.source.fullNa me}"; 52 text += " from ${element.library.definingCompilationUnit.source.fullNa me}";
53 } 53 }
54 } 54 }
55 } 55 }
56 print(text); 56 print(text);
57 return super.visitNode(node); 57 return super.visitNode(node);
58 } 58 }
59 } 59 }
60 60
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698