| 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 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:analyzer/src/context/cache.dart'; | 10 import 'package:analyzer/src/context/cache.dart'; |
| (...skipping 3235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3246 : super(context, target); | 3246 : super(context, target); |
| 3247 | 3247 |
| 3248 @override | 3248 @override |
| 3249 TaskDescriptor get descriptor => DESCRIPTOR; | 3249 TaskDescriptor get descriptor => DESCRIPTOR; |
| 3250 | 3250 |
| 3251 @override | 3251 @override |
| 3252 void internalPerform() { | 3252 void internalPerform() { |
| 3253 RecordingErrorListener errorListener = new RecordingErrorListener(); | 3253 RecordingErrorListener errorListener = new RecordingErrorListener(); |
| 3254 Source source = getRequiredSource(); | 3254 Source source = getRequiredSource(); |
| 3255 errorReporter = new ErrorReporter(errorListener, source); | 3255 errorReporter = new ErrorReporter(errorListener, source); |
| 3256 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); | |
| 3257 // | 3256 // |
| 3258 // Prepare inputs. | 3257 // Prepare inputs. |
| 3259 // | 3258 // |
| 3259 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); |
| 3260 CompilationUnit unit = getRequiredInput(UNIT_INPUT); | 3260 CompilationUnit unit = getRequiredInput(UNIT_INPUT); |
| 3261 CompilationUnitElement unitElement = unit.element; | 3261 CompilationUnitElement unitElement = unit.element; |
| 3262 LibraryElement libraryElement = unitElement.library; | 3262 LibraryElement libraryElement = unitElement.library; |
| 3263 // | 3263 // |
| 3264 // Validate the directives. | 3264 // Validate the directives. |
| 3265 // | 3265 // |
| 3266 validateDirectives(unit); | 3266 validateDirectives(unit); |
| 3267 // | 3267 // |
| 3268 // Use the ErrorVerifier to compute errors. | 3268 // Use the ErrorVerifier to compute errors. |
| 3269 // | 3269 // |
| 3270 ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, | 3270 ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, |
| 3271 libraryElement, typeProvider, new InheritanceManager(libraryElement)); | 3271 libraryElement, typeProvider, new InheritanceManager(libraryElement)); |
| 3272 unit.accept(errorVerifier); | 3272 unit.accept(errorVerifier); |
| 3273 // | 3273 // |
| 3274 // Use the ConstantVerifier to compute errors. |
| 3275 // |
| 3276 ConstantVerifier constantVerifier = new ConstantVerifier( |
| 3277 errorReporter, libraryElement, typeProvider, context.declaredVariables); |
| 3278 unit.accept(constantVerifier); |
| 3279 // |
| 3274 // Record outputs. | 3280 // Record outputs. |
| 3275 // | 3281 // |
| 3276 outputs[VERIFY_ERRORS] = errorListener.errors; | 3282 outputs[VERIFY_ERRORS] = errorListener.errors; |
| 3277 } | 3283 } |
| 3278 | 3284 |
| 3279 /** | 3285 /** |
| 3280 * Check each directive in the given [unit] to see if the referenced source | 3286 * Check each directive in the given [unit] to see if the referenced source |
| 3281 * exists and report an error if it does not. | 3287 * exists and report an error if it does not. |
| 3282 */ | 3288 */ |
| 3283 void validateDirectives(CompilationUnit unit) { | 3289 void validateDirectives(CompilationUnit unit) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3431 @override | 3437 @override |
| 3432 bool moveNext() { | 3438 bool moveNext() { |
| 3433 if (_newSources.isEmpty) { | 3439 if (_newSources.isEmpty) { |
| 3434 return false; | 3440 return false; |
| 3435 } | 3441 } |
| 3436 currentTarget = _newSources.first; | 3442 currentTarget = _newSources.first; |
| 3437 _newSources.remove(currentTarget); | 3443 _newSources.remove(currentTarget); |
| 3438 return true; | 3444 return true; |
| 3439 } | 3445 } |
| 3440 } | 3446 } |
| OLD | NEW |