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

Side by Side Diff: pkg/analyzer/example/parser_driver.dart

Issue 725143004: Format and sort analyzer and analysis_server packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | « pkg/analyzer/bin/formatter.dart ('k') | pkg/analyzer/example/resolver_driver.dart » ('j') | 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
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 // 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 3 // 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. 4 // BSD-style license that can be found in the LICENSE file.
6 5
7 import 'dart:io'; 6 import 'dart:io';
8 7
9 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/error.dart'; 9 import 'package:analyzer/src/generated/error.dart';
11 import 'package:analyzer/src/generated/parser.dart'; 10 import 'package:analyzer/src/generated/parser.dart';
12 import 'package:analyzer/src/generated/scanner.dart'; 11 import 'package:analyzer/src/generated/scanner.dart';
(...skipping 24 matching lines...) Expand all
37 var unit = parser.parseCompilationUnit(token); 36 var unit = parser.parseCompilationUnit(token);
38 37
39 var visitor = new _ASTVisitor(); 38 var visitor = new _ASTVisitor();
40 unit.accept(visitor); 39 unit.accept(visitor);
41 40
42 for (var error in errorListener.errors) { 41 for (var error in errorListener.errors) {
43 print(error); 42 print(error);
44 } 43 }
45 } 44 }
46 45
47 class _ErrorCollector extends AnalysisErrorListener {
48 List<AnalysisError> errors;
49 _ErrorCollector() : errors = new List<AnalysisError>();
50 onError(error) => errors.add(error);
51 }
52
53 class _ASTVisitor extends GeneralizingAstVisitor { 46 class _ASTVisitor extends GeneralizingAstVisitor {
54 visitNode(AstNode node) { 47 visitNode(AstNode node) {
55 print('${node.runtimeType} : <"$node">'); 48 print('${node.runtimeType} : <"$node">');
56 return super.visitNode(node); 49 return super.visitNode(node);
57 } 50 }
58 } 51 }
59 52
53 class _ErrorCollector extends AnalysisErrorListener {
54 List<AnalysisError> errors;
55 _ErrorCollector() : errors = new List<AnalysisError>();
56 onError(error) => errors.add(error);
57 }
OLDNEW
« no previous file with comments | « pkg/analyzer/bin/formatter.dart ('k') | pkg/analyzer/example/resolver_driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698