OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/error/listener.dart'; | 8 import 'package:analyzer/error/listener.dart'; |
9 import 'package:analyzer/src/dart/scanner/reader.dart'; | 9 import 'package:analyzer/src/dart/scanner/reader.dart'; |
10 import 'package:analyzer/src/generated/parser.dart'; | 10 import 'package:analyzer/src/generated/parser.dart'; |
(...skipping 23 matching lines...) Expand all Loading... |
34 var startingPoint = new _StartingPoint(walker, sources); | 34 var startingPoint = new _StartingPoint(walker, sources); |
35 await walker.walk(startingPoint); | 35 await walker.walk(startingPoint); |
36 return walker.graph; | 36 return walker.graph; |
37 } | 37 } |
38 | 38 |
39 /// Type of the callback function used by [graphForProgram] to read file | 39 /// Type of the callback function used by [graphForProgram] to read file |
40 /// contents. | 40 /// contents. |
41 typedef Future<String> FileReader(Uri originalUri, Uri resolvedUri); | 41 typedef Future<String> FileReader(Uri originalUri, Uri resolvedUri); |
42 | 42 |
43 class _Scanner extends Scanner { | 43 class _Scanner extends Scanner { |
44 _Scanner(String contents) : super(new CharSequenceReader(contents)) { | 44 _Scanner(String contents) : super.create(new CharSequenceReader(contents)) { |
45 preserveComments = false; | 45 preserveComments = false; |
46 } | 46 } |
47 | 47 |
48 @override | 48 @override |
49 void reportError(errorCode, int offset, List<Object> arguments) { | 49 void reportError(errorCode, int offset, List<Object> arguments) { |
50 // TODO(paulberry): report errors. | 50 // TODO(paulberry): report errors. |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 class _StartingPoint extends _WalkerNode { | 54 class _StartingPoint extends _WalkerNode { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 handleDependency(referencedUri); | 142 handleDependency(referencedUri); |
143 } | 143 } |
144 } | 144 } |
145 } | 145 } |
146 if (!coreUriFound) { | 146 if (!coreUriFound) { |
147 handleDependency(dartCoreUri); | 147 handleDependency(dartCoreUri); |
148 } | 148 } |
149 return dependencies; | 149 return dependencies; |
150 } | 150 } |
151 } | 151 } |
OLD | NEW |