OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
7 | 7 |
8 library engine; | 8 library engine; |
9 | 9 |
10 import "dart:math" as math; | 10 import "dart:math" as math; |
(...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 _cache.storedAst(source); | 2363 _cache.storedAst(source); |
2364 } else { | 2364 } else { |
2365 dartEntry.recordResolutionErrorInLibrary( | 2365 dartEntry.recordResolutionErrorInLibrary( |
2366 librarySource, | 2366 librarySource, |
2367 thrownException); | 2367 thrownException); |
2368 } | 2368 } |
2369 if (source != librarySource) { | 2369 if (source != librarySource) { |
2370 _workManager.add(source, SourcePriority.PRIORITY_PART); | 2370 _workManager.add(source, SourcePriority.PRIORITY_PART); |
2371 } | 2371 } |
2372 ChangeNoticeImpl notice = _getNotice(source); | 2372 ChangeNoticeImpl notice = _getNotice(source); |
2373 notice.compilationUnit = unit; | 2373 notice.resolvedDartUnit = unit; |
2374 notice.setErrors(dartEntry.allErrors, lineInfo); | 2374 notice.setErrors(dartEntry.allErrors, lineInfo); |
2375 } | 2375 } |
2376 } | 2376 } |
2377 } | 2377 } |
2378 if (thrownException != null) { | 2378 if (thrownException != null) { |
2379 throw new AnalysisException('<rethrow>', thrownException); | 2379 throw new AnalysisException('<rethrow>', thrownException); |
2380 } | 2380 } |
2381 return unitEntry; | 2381 return unitEntry; |
2382 } | 2382 } |
2383 | 2383 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2447 } else { | 2447 } else { |
2448 dartEntry.recordResolutionErrorInLibrary( | 2448 dartEntry.recordResolutionErrorInLibrary( |
2449 librarySource, | 2449 librarySource, |
2450 thrownException); | 2450 thrownException); |
2451 _cache.remove(source); | 2451 _cache.remove(source); |
2452 } | 2452 } |
2453 if (source != librarySource) { | 2453 if (source != librarySource) { |
2454 _workManager.add(source, SourcePriority.PRIORITY_PART); | 2454 _workManager.add(source, SourcePriority.PRIORITY_PART); |
2455 } | 2455 } |
2456 ChangeNoticeImpl notice = _getNotice(source); | 2456 ChangeNoticeImpl notice = _getNotice(source); |
2457 notice.compilationUnit = unit; | 2457 notice.resolvedDartUnit = unit; |
2458 notice.setErrors(dartEntry.allErrors, lineInfo); | 2458 notice.setErrors(dartEntry.allErrors, lineInfo); |
2459 } | 2459 } |
2460 } | 2460 } |
2461 } | 2461 } |
2462 if (thrownException != null) { | 2462 if (thrownException != null) { |
2463 throw new AnalysisException('<rethrow>', thrownException); | 2463 throw new AnalysisException('<rethrow>', thrownException); |
2464 } | 2464 } |
2465 return unitEntry; | 2465 return unitEntry; |
2466 } | 2466 } |
2467 | 2467 |
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 * | 4619 * |
4620 * @param task the task that was performed | 4620 * @param task the task that was performed |
4621 * @return an entry containing the computed results | 4621 * @return an entry containing the computed results |
4622 * @throws AnalysisException if the results could not be recorded | 4622 * @throws AnalysisException if the results could not be recorded |
4623 */ | 4623 */ |
4624 DartEntry | 4624 DartEntry |
4625 _recordIncrementalAnalysisTaskResults(IncrementalAnalysisTask task) { | 4625 _recordIncrementalAnalysisTaskResults(IncrementalAnalysisTask task) { |
4626 CompilationUnit unit = task.compilationUnit; | 4626 CompilationUnit unit = task.compilationUnit; |
4627 if (unit != null) { | 4627 if (unit != null) { |
4628 ChangeNoticeImpl notice = _getNotice(task.source); | 4628 ChangeNoticeImpl notice = _getNotice(task.source); |
4629 notice.compilationUnit = unit; | 4629 notice.resolvedDartUnit = unit; |
4630 _incrementalAnalysisCache = | 4630 _incrementalAnalysisCache = |
4631 IncrementalAnalysisCache.cacheResult(task.cache, unit); | 4631 IncrementalAnalysisCache.cacheResult(task.cache, unit); |
4632 } | 4632 } |
4633 return null; | 4633 return null; |
4634 } | 4634 } |
4635 | 4635 |
4636 /** | 4636 /** |
4637 * Record the results produced by performing a [task] and return the cache | 4637 * Record the results produced by performing a [task] and return the cache |
4638 * entry associated with the results. | 4638 * entry associated with the results. |
4639 */ | 4639 */ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4680 partEntry.addContainingLibrary(source); | 4680 partEntry.addContainingLibrary(source); |
4681 } | 4681 } |
4682 } | 4682 } |
4683 dartEntry.setValue(DartEntry.PARSED_UNIT, task.compilationUnit); | 4683 dartEntry.setValue(DartEntry.PARSED_UNIT, task.compilationUnit); |
4684 dartEntry.setValue(DartEntry.PARSE_ERRORS, task.errors); | 4684 dartEntry.setValue(DartEntry.PARSE_ERRORS, task.errors); |
4685 dartEntry.setValue(DartEntry.EXPORTED_LIBRARIES, task.exportedSources); | 4685 dartEntry.setValue(DartEntry.EXPORTED_LIBRARIES, task.exportedSources); |
4686 dartEntry.setValue(DartEntry.IMPORTED_LIBRARIES, task.importedSources); | 4686 dartEntry.setValue(DartEntry.IMPORTED_LIBRARIES, task.importedSources); |
4687 dartEntry.setValue(DartEntry.INCLUDED_PARTS, newParts); | 4687 dartEntry.setValue(DartEntry.INCLUDED_PARTS, newParts); |
4688 _cache.storedAst(source); | 4688 _cache.storedAst(source); |
4689 ChangeNoticeImpl notice = _getNotice(source); | 4689 ChangeNoticeImpl notice = _getNotice(source); |
4690 if (notice.compilationUnit == null) { | 4690 if (notice.resolvedDartUnit == null) { |
4691 notice.parsedDartUnit = task.compilationUnit; | 4691 notice.parsedDartUnit = task.compilationUnit; |
4692 } | 4692 } |
4693 notice.setErrors(dartEntry.allErrors, task.lineInfo); | 4693 notice.setErrors(dartEntry.allErrors, task.lineInfo); |
4694 // Verify that the incrementally parsed and resolved unit in the incremental | 4694 // Verify that the incrementally parsed and resolved unit in the incremental |
4695 // cache is structurally equivalent to the fully parsed unit | 4695 // cache is structurally equivalent to the fully parsed unit |
4696 _incrementalAnalysisCache = IncrementalAnalysisCache.verifyStructure( | 4696 _incrementalAnalysisCache = IncrementalAnalysisCache.verifyStructure( |
4697 _incrementalAnalysisCache, | 4697 _incrementalAnalysisCache, |
4698 source, | 4698 source, |
4699 task.compilationUnit); | 4699 task.compilationUnit); |
4700 return dartEntry; | 4700 return dartEntry; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4760 htmlEntry.recordResolutionError(thrownException); | 4760 htmlEntry.recordResolutionError(thrownException); |
4761 _cache.removedAst(source); | 4761 _cache.removedAst(source); |
4762 throw new AnalysisException('<rethrow>', thrownException); | 4762 throw new AnalysisException('<rethrow>', thrownException); |
4763 } | 4763 } |
4764 htmlEntry.setState(HtmlEntry.PARSED_UNIT, CacheState.FLUSHED); | 4764 htmlEntry.setState(HtmlEntry.PARSED_UNIT, CacheState.FLUSHED); |
4765 htmlEntry.setValue(HtmlEntry.RESOLVED_UNIT, task.resolvedUnit); | 4765 htmlEntry.setValue(HtmlEntry.RESOLVED_UNIT, task.resolvedUnit); |
4766 htmlEntry.setValue(HtmlEntry.ELEMENT, task.element); | 4766 htmlEntry.setValue(HtmlEntry.ELEMENT, task.element); |
4767 htmlEntry.setValue(HtmlEntry.RESOLUTION_ERRORS, task.resolutionErrors); | 4767 htmlEntry.setValue(HtmlEntry.RESOLUTION_ERRORS, task.resolutionErrors); |
4768 _cache.storedAst(source); | 4768 _cache.storedAst(source); |
4769 ChangeNoticeImpl notice = _getNotice(source); | 4769 ChangeNoticeImpl notice = _getNotice(source); |
4770 notice.htmlUnit = task.resolvedUnit; | 4770 notice.resolvedHtmlUnit = task.resolvedUnit; |
4771 LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO); | 4771 LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO); |
4772 notice.setErrors(htmlEntry.allErrors, lineInfo); | 4772 notice.setErrors(htmlEntry.allErrors, lineInfo); |
4773 return htmlEntry; | 4773 return htmlEntry; |
4774 } | 4774 } |
4775 | 4775 |
4776 /** | 4776 /** |
4777 * Record the results produced by performing a [task] and return the cache | 4777 * Record the results produced by performing a [task] and return the cache |
4778 * entry associated with the results. | 4778 * entry associated with the results. |
4779 */ | 4779 */ |
4780 DartEntry _recordScanDartTaskResults(ScanDartTask task) { | 4780 DartEntry _recordScanDartTaskResults(ScanDartTask task) { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4923 DartEntry dartEntry = _cache.get(source); | 4923 DartEntry dartEntry = _cache.get(source); |
4924 _removeFromParts(source, dartEntry); | 4924 _removeFromParts(source, dartEntry); |
4925 dartEntry.modificationTime = getModificationStamp(source); | 4925 dartEntry.modificationTime = getModificationStamp(source); |
4926 dartEntry.invalidateAllInformation(); | 4926 dartEntry.invalidateAllInformation(); |
4927 _cache.removedAst(source); | 4927 _cache.removedAst(source); |
4928 _workManager.add(source, SourcePriority.UNKNOWN); | 4928 _workManager.add(source, SourcePriority.UNKNOWN); |
4929 } | 4929 } |
4930 // reset unit in the notification, it is out of date now | 4930 // reset unit in the notification, it is out of date now |
4931 ChangeNoticeImpl notice = _pendingNotices[source]; | 4931 ChangeNoticeImpl notice = _pendingNotices[source]; |
4932 if (notice != null) { | 4932 if (notice != null) { |
4933 notice.compilationUnit = null; | 4933 notice.resolvedDartUnit = null; |
4934 notice.htmlUnit = null; | 4934 notice.resolvedHtmlUnit = null; |
4935 } | 4935 } |
4936 } | 4936 } |
4937 | 4937 |
4938 /** | 4938 /** |
4939 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. | 4939 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. |
4940 * | 4940 * |
4941 * @param source the source that has been deleted | 4941 * @param source the source that has been deleted |
4942 */ | 4942 */ |
4943 void _sourceDeleted(Source source) { | 4943 void _sourceDeleted(Source source) { |
4944 SourceEntry sourceEntry = _cache.get(source); | 4944 SourceEntry sourceEntry = _cache.get(source); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5057 incrementalResolutionValidation_lastLibrarySource = | 5057 incrementalResolutionValidation_lastLibrarySource = |
5058 oldUnit.element.library.source; | 5058 oldUnit.element.library.source; |
5059 incrementalResolutionValidation_lastUnit = oldUnit; | 5059 incrementalResolutionValidation_lastUnit = oldUnit; |
5060 return false; | 5060 return false; |
5061 } | 5061 } |
5062 // prepare notices | 5062 // prepare notices |
5063 units.forEach((Source source, CompilationUnit unit) { | 5063 units.forEach((Source source, CompilationUnit unit) { |
5064 DartEntry dartEntry = _cache.get(source); | 5064 DartEntry dartEntry = _cache.get(source); |
5065 LineInfo lineInfo = getLineInfo(source); | 5065 LineInfo lineInfo = getLineInfo(source); |
5066 ChangeNoticeImpl notice = _getNotice(source); | 5066 ChangeNoticeImpl notice = _getNotice(source); |
5067 notice.compilationUnit = unit; | 5067 notice.resolvedDartUnit = unit; |
5068 notice.setErrors(dartEntry.allErrors, lineInfo); | 5068 notice.setErrors(dartEntry.allErrors, lineInfo); |
5069 }); | 5069 }); |
5070 // OK | 5070 // OK |
5071 return true; | 5071 return true; |
5072 } | 5072 } |
5073 | 5073 |
5074 /** | 5074 /** |
5075 * Check the cache for any invalid entries (entries whose modification time do
es not match the | 5075 * Check the cache for any invalid entries (entries whose modification time do
es not match the |
5076 * modification time of the source associated with the entry). Invalid entries
will be marked as | 5076 * modification time of the source associated with the entry). Invalid entries
will be marked as |
5077 * invalid so that the source will be re-analyzed. | 5077 * invalid so that the source will be re-analyzed. |
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7233 | 7233 |
7234 const CacheState(String name, int ordinal) : super(name, ordinal); | 7234 const CacheState(String name, int ordinal) : super(name, ordinal); |
7235 } | 7235 } |
7236 | 7236 |
7237 /** | 7237 /** |
7238 * An object that represents a change to the analysis results associated with a | 7238 * An object that represents a change to the analysis results associated with a |
7239 * given source. | 7239 * given source. |
7240 */ | 7240 */ |
7241 abstract class ChangeNotice implements AnalysisErrorInfo { | 7241 abstract class ChangeNotice implements AnalysisErrorInfo { |
7242 /** | 7242 /** |
7243 * The fully resolved Dart AST that changed as a result of the analysis, or | |
7244 * `null` if the AST was not changed. | |
7245 */ | |
7246 CompilationUnit get compilationUnit; | |
7247 | |
7248 /** | |
7249 * The fully resolved HTML AST that changed as a result of the analysis, or | |
7250 * `null` if the AST was not changed. | |
7251 */ | |
7252 ht.HtmlUnit get htmlUnit; | |
7253 | |
7254 /** | |
7255 * The parsed, but maybe not resolved Dart AST that changed as a result of | 7243 * The parsed, but maybe not resolved Dart AST that changed as a result of |
7256 * the analysis, or `null` if the AST was not changed. | 7244 * the analysis, or `null` if the AST was not changed. |
7257 */ | 7245 */ |
7258 CompilationUnit get parsedDartUnit; | 7246 CompilationUnit get parsedDartUnit; |
7259 | 7247 |
7260 /** | 7248 /** |
| 7249 * The fully resolved Dart AST that changed as a result of the analysis, or |
| 7250 * `null` if the AST was not changed. |
| 7251 */ |
| 7252 CompilationUnit get resolvedDartUnit; |
| 7253 |
| 7254 /** |
| 7255 * The fully resolved HTML AST that changed as a result of the analysis, or |
| 7256 * `null` if the AST was not changed. |
| 7257 */ |
| 7258 ht.HtmlUnit get resolvedHtmlUnit; |
| 7259 |
| 7260 /** |
7261 * Return the source for which the result is being reported. | 7261 * Return the source for which the result is being reported. |
7262 */ | 7262 */ |
7263 Source get source; | 7263 Source get source; |
7264 } | 7264 } |
7265 | 7265 |
7266 /** | 7266 /** |
7267 * An implementation of a [ChangeNotice]. | 7267 * An implementation of a [ChangeNotice]. |
7268 */ | 7268 */ |
7269 class ChangeNoticeImpl implements ChangeNotice { | 7269 class ChangeNoticeImpl implements ChangeNotice { |
7270 /** | 7270 /** |
7271 * An empty list of change notices. | 7271 * An empty list of change notices. |
7272 */ | 7272 */ |
7273 static const List<ChangeNoticeImpl> EMPTY_ARRAY = const <ChangeNoticeImpl>[]; | 7273 static const List<ChangeNoticeImpl> EMPTY_ARRAY = const <ChangeNoticeImpl>[]; |
7274 | 7274 |
7275 /** | 7275 /** |
7276 * The source for which the result is being reported. | 7276 * The source for which the result is being reported. |
7277 */ | 7277 */ |
7278 final Source source; | 7278 final Source source; |
7279 | 7279 |
7280 /** | 7280 /** |
7281 * The parsed, but maybe not resolved Dart AST that changed as a result of | 7281 * The parsed, but maybe not resolved Dart AST that changed as a result of |
7282 * the analysis, or `null` if the AST was not changed. | 7282 * the analysis, or `null` if the AST was not changed. |
7283 */ | 7283 */ |
7284 CompilationUnit parsedDartUnit; | 7284 CompilationUnit parsedDartUnit; |
7285 | 7285 |
7286 /** | 7286 /** |
7287 * The fully resolved Dart AST that changed as a result of the analysis, or | 7287 * The fully resolved Dart AST that changed as a result of the analysis, or |
7288 * `null` if the AST was not changed. | 7288 * `null` if the AST was not changed. |
7289 */ | 7289 */ |
7290 CompilationUnit compilationUnit; | 7290 CompilationUnit resolvedDartUnit; |
7291 | 7291 |
7292 /** | 7292 /** |
7293 * The fully resolved HTML AST that changed as a result of the analysis, or | 7293 * The fully resolved HTML AST that changed as a result of the analysis, or |
7294 * `null` if the AST was not changed. | 7294 * `null` if the AST was not changed. |
7295 */ | 7295 */ |
7296 ht.HtmlUnit htmlUnit; | 7296 ht.HtmlUnit resolvedHtmlUnit; |
7297 | 7297 |
7298 /** | 7298 /** |
7299 * The errors that changed as a result of the analysis, or `null` if errors | 7299 * The errors that changed as a result of the analysis, or `null` if errors |
7300 * were not changed. | 7300 * were not changed. |
7301 */ | 7301 */ |
7302 List<AnalysisError> _errors; | 7302 List<AnalysisError> _errors; |
7303 | 7303 |
7304 /** | 7304 /** |
7305 * The line information associated with the source, or `null` if errors were | 7305 * The line information associated with the source, or `null` if errors were |
7306 * not changed. | 7306 * not changed. |
(...skipping 4971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12278 if (element.id == _id) { | 12278 if (element.id == _id) { |
12279 result = element; | 12279 result = element; |
12280 throw new _ElementByIdFinderException(); | 12280 throw new _ElementByIdFinderException(); |
12281 } | 12281 } |
12282 super.visitElement(element); | 12282 super.visitElement(element); |
12283 } | 12283 } |
12284 } | 12284 } |
12285 | 12285 |
12286 class _ElementByIdFinderException { | 12286 class _ElementByIdFinderException { |
12287 } | 12287 } |
OLD | NEW |