| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.src.task.dart; | 5 library analyzer.src.task.dart; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 /** | 554 /** |
| 555 * The flag specifying that [RESOLVED_UNIT] is ready for all of the units of a | 555 * The flag specifying that [RESOLVED_UNIT] is ready for all of the units of a |
| 556 * library. | 556 * library. |
| 557 * | 557 * |
| 558 * The result is only available for [Source]s representing a library. | 558 * The result is only available for [Source]s representing a library. |
| 559 */ | 559 */ |
| 560 final ResultDescriptor<bool> READY_RESOLVED_UNIT = | 560 final ResultDescriptor<bool> READY_RESOLVED_UNIT = |
| 561 new ResultDescriptor<bool>('READY_RESOLVED_UNIT', false); | 561 new ResultDescriptor<bool>('READY_RESOLVED_UNIT', false); |
| 562 | 562 |
| 563 /** | 563 /** |
| 564 * The flag specifying that [RESOLVED_UNIT10] is ready for all of the units of a | |
| 565 * library and its import/export closure. | |
| 566 * | |
| 567 * The result is only available for [Source]s representing a library. | |
| 568 */ | |
| 569 final ResultDescriptor<bool> READY_RESOLVED_UNIT10 = | |
| 570 new ResultDescriptor<bool>('READY_RESOLVED_UNIT10', false); | |
| 571 | |
| 572 /** | |
| 573 * The flag specifying that [RESOLVED_UNIT11] is ready for all of the units of a | |
| 574 * library and its import/export closure. | |
| 575 * | |
| 576 * The result is only available for [Source]s representing a library. | |
| 577 */ | |
| 578 final ResultDescriptor<bool> READY_RESOLVED_UNIT11 = | |
| 579 new ResultDescriptor<bool>('READY_RESOLVED_UNIT11', false); | |
| 580 | |
| 581 /** | |
| 582 * The names (resolved and not) referenced by a unit. | 564 * The names (resolved and not) referenced by a unit. |
| 583 * | 565 * |
| 584 * The result is only available for [Source]s representing a compilation unit. | 566 * The result is only available for [Source]s representing a compilation unit. |
| 585 */ | 567 */ |
| 586 final ResultDescriptor<ReferencedNames> REFERENCED_NAMES = | 568 final ResultDescriptor<ReferencedNames> REFERENCED_NAMES = |
| 587 new ResultDescriptor<ReferencedNames>('REFERENCED_NAMES', null); | 569 new ResultDescriptor<ReferencedNames>('REFERENCED_NAMES', null); |
| 588 | 570 |
| 589 /** | 571 /** |
| 590 * The errors produced while resolving type names. | 572 * The errors produced while resolving type names. |
| 591 * | 573 * |
| (...skipping 3472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4064 }; | 4046 }; |
| 4065 } | 4047 } |
| 4066 | 4048 |
| 4067 static ReadyLibraryElement6Task createTask( | 4049 static ReadyLibraryElement6Task createTask( |
| 4068 AnalysisContext context, AnalysisTarget target) { | 4050 AnalysisContext context, AnalysisTarget target) { |
| 4069 return new ReadyLibraryElement6Task(context, target); | 4051 return new ReadyLibraryElement6Task(context, target); |
| 4070 } | 4052 } |
| 4071 } | 4053 } |
| 4072 | 4054 |
| 4073 /** | 4055 /** |
| 4074 * A task that ensures that [RESOLVED_UNIT10] is ready for every unit of the | |
| 4075 * target library source and its import/export closure. | |
| 4076 */ | |
| 4077 class ReadyResolvedUnit10Task extends SourceBasedAnalysisTask { | |
| 4078 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( | |
| 4079 'ReadyResolvedUnit10Task', | |
| 4080 createTask, | |
| 4081 buildInputs, | |
| 4082 <ResultDescriptor>[READY_RESOLVED_UNIT10]); | |
| 4083 | |
| 4084 ReadyResolvedUnit10Task( | |
| 4085 InternalAnalysisContext context, AnalysisTarget target) | |
| 4086 : super(context, target); | |
| 4087 | |
| 4088 @override | |
| 4089 TaskDescriptor get descriptor => DESCRIPTOR; | |
| 4090 | |
| 4091 @override | |
| 4092 bool get handlesDependencyCycles => true; | |
| 4093 | |
| 4094 @override | |
| 4095 void internalPerform() { | |
| 4096 outputs[READY_RESOLVED_UNIT10] = true; | |
| 4097 } | |
| 4098 | |
| 4099 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | |
| 4100 Source source = target; | |
| 4101 return <String, TaskInput>{ | |
| 4102 'thisLibraryUnitsReady': | |
| 4103 LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT10), | |
| 4104 'directlyImportedLibrariesReady': | |
| 4105 IMPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT10), | |
| 4106 'directlyExportedLibrariesReady': | |
| 4107 EXPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT10), | |
| 4108 }; | |
| 4109 } | |
| 4110 | |
| 4111 static ReadyResolvedUnit10Task createTask( | |
| 4112 AnalysisContext context, AnalysisTarget target) { | |
| 4113 return new ReadyResolvedUnit10Task(context, target); | |
| 4114 } | |
| 4115 } | |
| 4116 | |
| 4117 /** | |
| 4118 * A task that ensures that [RESOLVED_UNIT11] is ready for every unit of the | |
| 4119 * target library source and its import/export closure. | |
| 4120 */ | |
| 4121 class ReadyResolvedUnit11Task extends SourceBasedAnalysisTask { | |
| 4122 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( | |
| 4123 'ReadyResolvedUnit11Task', | |
| 4124 createTask, | |
| 4125 buildInputs, | |
| 4126 <ResultDescriptor>[READY_RESOLVED_UNIT11]); | |
| 4127 | |
| 4128 ReadyResolvedUnit11Task( | |
| 4129 InternalAnalysisContext context, AnalysisTarget target) | |
| 4130 : super(context, target); | |
| 4131 | |
| 4132 @override | |
| 4133 TaskDescriptor get descriptor => DESCRIPTOR; | |
| 4134 | |
| 4135 @override | |
| 4136 bool get handlesDependencyCycles => true; | |
| 4137 | |
| 4138 @override | |
| 4139 void internalPerform() { | |
| 4140 outputs[READY_RESOLVED_UNIT11] = true; | |
| 4141 } | |
| 4142 | |
| 4143 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | |
| 4144 Source source = target; | |
| 4145 return <String, TaskInput>{ | |
| 4146 'thisLibraryUnitsReady': | |
| 4147 LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT11), | |
| 4148 'directlyImportedLibrariesReady': | |
| 4149 IMPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT11), | |
| 4150 'directlyExportedLibrariesReady': | |
| 4151 EXPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT11), | |
| 4152 }; | |
| 4153 } | |
| 4154 | |
| 4155 static ReadyResolvedUnit11Task createTask( | |
| 4156 AnalysisContext context, AnalysisTarget target) { | |
| 4157 return new ReadyResolvedUnit11Task(context, target); | |
| 4158 } | |
| 4159 } | |
| 4160 | |
| 4161 /** | |
| 4162 * A task that ensures that [RESOLVED_UNIT] is ready for every unit of the | 4056 * A task that ensures that [RESOLVED_UNIT] is ready for every unit of the |
| 4163 * target library source and its import/export closure. | 4057 * target library source and its import/export closure. |
| 4164 */ | 4058 */ |
| 4165 class ReadyResolvedUnitTask extends SourceBasedAnalysisTask { | 4059 class ReadyResolvedUnitTask extends SourceBasedAnalysisTask { |
| 4166 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( | 4060 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( |
| 4167 'ReadyResolvedUnitTask', | 4061 'ReadyResolvedUnitTask', |
| 4168 createTask, | 4062 createTask, |
| 4169 buildInputs, | 4063 buildInputs, |
| 4170 <ResultDescriptor>[READY_RESOLVED_UNIT]); | 4064 <ResultDescriptor>[READY_RESOLVED_UNIT]); |
| 4171 | 4065 |
| (...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5338 | 5232 |
| 5339 @override | 5233 @override |
| 5340 bool moveNext() { | 5234 bool moveNext() { |
| 5341 if (_newSources.isEmpty) { | 5235 if (_newSources.isEmpty) { |
| 5342 return false; | 5236 return false; |
| 5343 } | 5237 } |
| 5344 currentTarget = _newSources.removeLast(); | 5238 currentTarget = _newSources.removeLast(); |
| 5345 return true; | 5239 return true; |
| 5346 } | 5240 } |
| 5347 } | 5241 } |
| OLD | NEW |