Chromium Code Reviews| 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:async'; | 10 import 'dart:async'; |
| 11 import 'dart:collection'; | 11 import 'dart:collection'; |
| 12 import 'dart:math' as math; | 12 import 'dart:math' as math; |
| 13 | 13 |
| 14 import 'package:analyzer/src/cancelable_future.dart'; | 14 import 'package:analyzer/src/cancelable_future.dart'; |
| 15 import 'package:analyzer/src/context/cache.dart' as cache; | 15 import 'package:analyzer/src/context/cache.dart' as cache; |
| 16 import 'package:analyzer/src/context/context.dart' as newContext; | 16 import 'package:analyzer/src/context/context.dart' as newContext; |
| 17 import 'package:analyzer/src/generated/incremental_resolution_validator.dart'; | 17 import 'package:analyzer/src/generated/incremental_resolution_validator.dart'; |
| 18 import 'package:analyzer/src/plugin/command_line_plugin.dart'; | 18 import 'package:analyzer/src/plugin/command_line_plugin.dart'; |
| 19 import 'package:analyzer/src/plugin/engine_plugin.dart'; | 19 import 'package:analyzer/src/plugin/engine_plugin.dart'; |
| 20 import 'package:analyzer/src/plugin/options_plugin.dart'; | 20 import 'package:analyzer/src/plugin/options_plugin.dart'; |
| 21 import 'package:analyzer/src/services/lint.dart'; | 21 import 'package:analyzer/src/services/lint.dart'; |
| 22 import 'package:analyzer/src/task/manager.dart'; | 22 import 'package:analyzer/src/task/manager.dart'; |
| 23 import 'package:analyzer/src/task/task_dart.dart'; | 23 import 'package:analyzer/src/task/task_dart.dart'; |
| 24 import 'package:analyzer/task/dart.dart'; | 24 import 'package:analyzer/task/dart.dart'; |
| 25 import 'package:analyzer/task/model.dart'; | 25 import 'package:analyzer/task/model.dart'; |
| 26 import 'package:html/dom.dart' show Document; | |
| 26 import 'package:plugin/manager.dart'; | 27 import 'package:plugin/manager.dart'; |
| 27 import 'package:plugin/plugin.dart'; | 28 import 'package:plugin/plugin.dart'; |
| 28 | 29 |
| 29 import '../../instrumentation/instrumentation.dart'; | 30 import '../../instrumentation/instrumentation.dart'; |
| 30 import 'ast.dart'; | 31 import 'ast.dart'; |
| 31 import 'constant.dart'; | 32 import 'constant.dart'; |
| 32 import 'element.dart'; | 33 import 'element.dart'; |
| 33 import 'error.dart'; | 34 import 'error.dart'; |
| 34 import 'error_verifier.dart'; | 35 import 'error_verifier.dart'; |
| 35 import 'html.dart' as ht; | 36 import 'html.dart' as ht; |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 755 * resulting AST structure may or may not be resolved, and may have a slightly | 756 * resulting AST structure may or may not be resolved, and may have a slightly |
| 756 * different structure depending upon whether it is resolved. | 757 * different structure depending upon whether it is resolved. |
| 757 * | 758 * |
| 758 * Throws an [AnalysisException] if the analysis could not be performed | 759 * Throws an [AnalysisException] if the analysis could not be performed |
| 759 * | 760 * |
| 760 * <b>Note:</b> This method cannot be used in an async environment. | 761 * <b>Note:</b> This method cannot be used in an async environment. |
| 761 */ | 762 */ |
| 762 CompilationUnit parseCompilationUnit(Source source); | 763 CompilationUnit parseCompilationUnit(Source source); |
| 763 | 764 |
| 764 /** | 765 /** |
| 766 * Parse a single HTML [source] to produce a document model. | |
| 767 * | |
| 768 * Throws an [AnalysisException] if the analysis could not be performed | |
| 769 * | |
| 770 * <b>Note:</b> This method cannot be used in an async environment. | |
| 771 */ | |
| 772 Document parseDocument(Source source); | |
| 773 | |
| 774 /** | |
| 765 * Parse a single HTML [source] to produce an AST structure. The resulting | 775 * Parse a single HTML [source] to produce an AST structure. The resulting |
| 766 * HTML AST structure may or may not be resolved, and may have a slightly | 776 * HTML AST structure may or may not be resolved, and may have a slightly |
| 767 * different structure depending upon whether it is resolved. | 777 * different structure depending upon whether it is resolved. |
| 768 * | 778 * |
| 769 * Throws an [AnalysisException] if the analysis could not be performed | 779 * Throws an [AnalysisException] if the analysis could not be performed |
| 770 * | 780 * |
| 771 * <b>Note:</b> This method cannot be used in an async environment. | 781 * <b>Note:</b> This method cannot be used in an async environment. |
| 772 */ | 782 */ |
| 783 @deprecated // use parseDocument(source) | |
|
Paul Berry
2015/06/15 21:34:38
Rather than use an end-of-line comment, I'd recomm
Brian Wilkerson
2015/06/16 16:28:08
That's probably a good idea. I did it this way to
| |
| 773 ht.HtmlUnit parseHtmlUnit(Source source); | 784 ht.HtmlUnit parseHtmlUnit(Source source); |
| 774 | 785 |
| 775 /** | 786 /** |
| 776 * Perform the next unit of work required to keep the analysis results | 787 * Perform the next unit of work required to keep the analysis results |
| 777 * up-to-date and return information about the consequent changes to the | 788 * up-to-date and return information about the consequent changes to the |
| 778 * analysis results. This method can be long running. | 789 * analysis results. This method can be long running. |
| 779 * | 790 * |
| 780 * The implementation that uses the task model notifies subscribers of | 791 * The implementation that uses the task model notifies subscribers of |
| 781 * [onResultComputed] about computed results. | 792 * [onResultComputed] about computed results. |
| 782 * | 793 * |
| (...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2233 @override | 2244 @override |
| 2234 Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor) { | 2245 Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor) { |
| 2235 throw new NotImplementedException('In not task-based AnalysisContext.'); | 2246 throw new NotImplementedException('In not task-based AnalysisContext.'); |
| 2236 } | 2247 } |
| 2237 | 2248 |
| 2238 @override | 2249 @override |
| 2239 CompilationUnit parseCompilationUnit(Source source) => | 2250 CompilationUnit parseCompilationUnit(Source source) => |
| 2240 _getDartParseData2(source, DartEntry.PARSED_UNIT, null); | 2251 _getDartParseData2(source, DartEntry.PARSED_UNIT, null); |
| 2241 | 2252 |
| 2242 @override | 2253 @override |
| 2254 Document parseDocument(Source source) { | |
| 2255 return null; | |
| 2256 } | |
| 2257 | |
| 2258 @override | |
| 2243 ht.HtmlUnit parseHtmlUnit(Source source) => | 2259 ht.HtmlUnit parseHtmlUnit(Source source) => |
| 2244 _getHtmlParseData(source, HtmlEntry.PARSED_UNIT, null); | 2260 _getHtmlParseData(source, HtmlEntry.PARSED_UNIT, null); |
| 2245 | 2261 |
| 2246 @override | 2262 @override |
| 2247 AnalysisResult performAnalysisTask() { | 2263 AnalysisResult performAnalysisTask() { |
| 2248 if (_TRACE_PERFORM_TASK) { | 2264 if (_TRACE_PERFORM_TASK) { |
| 2249 print("----------------------------------------"); | 2265 print("----------------------------------------"); |
| 2250 } | 2266 } |
| 2251 return PerformanceStatistics.performAnaysis.makeCurrentWhile(() { | 2267 return PerformanceStatistics.performAnaysis.makeCurrentWhile(() { |
| 2252 int getStart = JavaSystem.currentTimeMillis(); | 2268 int getStart = JavaSystem.currentTimeMillis(); |
| (...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4019 /** | 4035 /** |
| 4020 * Notify all of the analysis listeners that a task is about to be performed. | 4036 * Notify all of the analysis listeners that a task is about to be performed. |
| 4021 */ | 4037 */ |
| 4022 void _notifyAboutToPerformTask(String taskDescription) { | 4038 void _notifyAboutToPerformTask(String taskDescription) { |
| 4023 int count = _listeners.length; | 4039 int count = _listeners.length; |
| 4024 for (int i = 0; i < count; i++) { | 4040 for (int i = 0; i < count; i++) { |
| 4025 _listeners[i].aboutToPerformTask(this, taskDescription); | 4041 _listeners[i].aboutToPerformTask(this, taskDescription); |
| 4026 } | 4042 } |
| 4027 } | 4043 } |
| 4028 | 4044 |
| 4029 /** | |
| 4030 * Notify all of the analysis listeners that the errors associated with the | |
| 4031 * given [source] has been updated to the given [errors]. | |
| 4032 */ | |
| 4033 void _notifyErrors( | |
| 4034 Source source, List<AnalysisError> errors, LineInfo lineInfo) { | |
| 4035 int count = _listeners.length; | |
| 4036 for (int i = 0; i < count; i++) { | |
| 4037 _listeners[i].computedErrors(this, source, errors, lineInfo); | |
| 4038 } | |
| 4039 } | |
| 4040 | |
| 4041 // /** | 4045 // /** |
| 4042 // * Notify all of the analysis listeners that the given source is no longer i ncluded in the set of | 4046 // * Notify all of the analysis listeners that the given source is no longer i ncluded in the set of |
| 4043 // * sources that are being analyzed. | 4047 // * sources that are being analyzed. |
| 4044 // * | 4048 // * |
| 4045 // * @param source the source that is no longer being analyzed | 4049 // * @param source the source that is no longer being analyzed |
| 4046 // */ | 4050 // */ |
| 4047 // void _notifyExcludedSource(Source source) { | 4051 // void _notifyExcludedSource(Source source) { |
| 4048 // int count = _listeners.length; | 4052 // int count = _listeners.length; |
| 4049 // for (int i = 0; i < count; i++) { | 4053 // for (int i = 0; i < count; i++) { |
| 4050 // _listeners[i].excludedSource(this, source); | 4054 // _listeners[i].excludedSource(this, source); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4110 // * @param unit the result of resolving the source | 4114 // * @param unit the result of resolving the source |
| 4111 // */ | 4115 // */ |
| 4112 // void _notifyResolvedHtml(Source source, ht.HtmlUnit unit) { | 4116 // void _notifyResolvedHtml(Source source, ht.HtmlUnit unit) { |
| 4113 // int count = _listeners.length; | 4117 // int count = _listeners.length; |
| 4114 // for (int i = 0; i < count; i++) { | 4118 // for (int i = 0; i < count; i++) { |
| 4115 // _listeners[i].resolvedHtml(this, source, unit); | 4119 // _listeners[i].resolvedHtml(this, source, unit); |
| 4116 // } | 4120 // } |
| 4117 // } | 4121 // } |
| 4118 | 4122 |
| 4119 /** | 4123 /** |
| 4124 * Notify all of the analysis listeners that the errors associated with the | |
| 4125 * given [source] has been updated to the given [errors]. | |
| 4126 */ | |
| 4127 void _notifyErrors( | |
| 4128 Source source, List<AnalysisError> errors, LineInfo lineInfo) { | |
| 4129 int count = _listeners.length; | |
| 4130 for (int i = 0; i < count; i++) { | |
| 4131 _listeners[i].computedErrors(this, source, errors, lineInfo); | |
| 4132 } | |
| 4133 } | |
| 4134 | |
| 4135 /** | |
| 4120 * Given that the given [source] (with the corresponding [sourceEntry]) has | 4136 * Given that the given [source] (with the corresponding [sourceEntry]) has |
| 4121 * been invalidated, invalidate all of the libraries that depend on it. | 4137 * been invalidated, invalidate all of the libraries that depend on it. |
| 4122 */ | 4138 */ |
| 4123 void _propagateInvalidation(Source source, SourceEntry sourceEntry) { | 4139 void _propagateInvalidation(Source source, SourceEntry sourceEntry) { |
| 4124 if (sourceEntry is HtmlEntry) { | 4140 if (sourceEntry is HtmlEntry) { |
| 4125 HtmlEntry htmlEntry = sourceEntry; | 4141 HtmlEntry htmlEntry = sourceEntry; |
| 4126 htmlEntry.modificationTime = getModificationStamp(source); | 4142 htmlEntry.modificationTime = getModificationStamp(source); |
| 4127 htmlEntry.invalidateAllInformation(); | 4143 htmlEntry.invalidateAllInformation(); |
| 4128 _cache.removedAst(source); | 4144 _cache.removedAst(source); |
| 4129 _workManager.add(source, SourcePriority.HTML); | 4145 _workManager.add(source, SourcePriority.HTML); |
| (...skipping 7674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11804 PendingFuture pendingFuture = | 11820 PendingFuture pendingFuture = |
| 11805 new PendingFuture<T>(_context, source, computeValue); | 11821 new PendingFuture<T>(_context, source, computeValue); |
| 11806 if (!pendingFuture.evaluate(sourceEntry)) { | 11822 if (!pendingFuture.evaluate(sourceEntry)) { |
| 11807 _context._pendingFutureSources | 11823 _context._pendingFutureSources |
| 11808 .putIfAbsent(source, () => <PendingFuture>[]) | 11824 .putIfAbsent(source, () => <PendingFuture>[]) |
| 11809 .add(pendingFuture); | 11825 .add(pendingFuture); |
| 11810 } | 11826 } |
| 11811 return pendingFuture.future; | 11827 return pendingFuture.future; |
| 11812 } | 11828 } |
| 11813 } | 11829 } |
| OLD | NEW |