| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library analyzer_impl; | 5 library analyzer_impl; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 UriKind uriKind = getUriKind(sourceFile); | 88 UriKind uriKind = getUriKind(sourceFile); |
| 89 librarySource = new FileBasedSource.con2(sourceFile, uriKind); | 89 librarySource = new FileBasedSource.con2(sourceFile, uriKind); |
| 90 | 90 |
| 91 // prepare context | 91 // prepare context |
| 92 prepareAnalysisContext(sourceFile, librarySource); | 92 prepareAnalysisContext(sourceFile, librarySource); |
| 93 } | 93 } |
| 94 | 94 |
| 95 /// The sync version of analysis | 95 /// The sync version of analysis |
| 96 ErrorSeverity _analyzeSync() { | 96 ErrorSeverity _analyzeSync() { |
| 97 // don't try to analyze parts | 97 // don't try to analyze parts |
| 98 if (context.getKindOf(librarySource) == SourceKind.PART) { | 98 if (context.computeKindOf(librarySource) == SourceKind.PART) { |
| 99 print("Only libraries can be analyzed."); | 99 print("Only libraries can be analyzed."); |
| 100 print("$sourcePath is a part and can not be analyzed."); | 100 print("$sourcePath is a part and can not be analyzed."); |
| 101 return ErrorSeverity.ERROR; | 101 return ErrorSeverity.ERROR; |
| 102 } | 102 } |
| 103 // resolve library | 103 // resolve library |
| 104 var libraryElement = context.computeLibraryElement(librarySource); | 104 var libraryElement = context.computeLibraryElement(librarySource); |
| 105 // prepare source and errors | 105 // prepare source and errors |
| 106 prepareSources(libraryElement); | 106 prepareSources(libraryElement); |
| 107 prepareErrors(); | 107 prepareErrors(); |
| 108 | 108 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 | 358 |
| 359 @override | 359 @override |
| 360 void logInformation2(String message, Exception exception) { | 360 void logInformation2(String message, Exception exception) { |
| 361 if (log) { | 361 if (log) { |
| 362 stdout.writeln(message); | 362 stdout.writeln(message); |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 } | 365 } |
| OLD | NEW |