| 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/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2606 Source source = getRequiredSource(); | 2606 Source source = getRequiredSource(); |
| 2607 ErrorReporter errorReporter = new ErrorReporter(errorListener, source); | 2607 ErrorReporter errorReporter = new ErrorReporter(errorListener, source); |
| 2608 // | 2608 // |
| 2609 // Prepare inputs. | 2609 // Prepare inputs. |
| 2610 // | 2610 // |
| 2611 CompilationUnit unit = getRequiredInput(RESOLVED_UNIT_INPUT); | 2611 CompilationUnit unit = getRequiredInput(RESOLVED_UNIT_INPUT); |
| 2612 | 2612 |
| 2613 // | 2613 // |
| 2614 // Generate lints. | 2614 // Generate lints. |
| 2615 // | 2615 // |
| 2616 List<Linter> linters = lintRegistry[context] ?? []; | 2616 List<Linter> linters = getLints(context); |
| 2617 linters.forEach((l) => l.reporter = errorReporter); | 2617 linters.forEach((l) => l.reporter = errorReporter); |
| 2618 Iterable<AstVisitor> visitors = linters.map((l) => l.getVisitor()).toList(); | 2618 Iterable<AstVisitor> visitors = linters.map((l) => l.getVisitor()).toList(); |
| 2619 unit.accept(new DelegatingAstVisitor(visitors.where((v) => v != null))); | 2619 unit.accept(new DelegatingAstVisitor(visitors.where((v) => v != null))); |
| 2620 | 2620 |
| 2621 // | 2621 // |
| 2622 // Record outputs. | 2622 // Record outputs. |
| 2623 // | 2623 // |
| 2624 outputs[LINTS] = errorListener.errors; | 2624 outputs[LINTS] = errorListener.errors; |
| 2625 } | 2625 } |
| 2626 | 2626 |
| (...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4528 | 4528 |
| 4529 @override | 4529 @override |
| 4530 bool moveNext() { | 4530 bool moveNext() { |
| 4531 if (_newSources.isEmpty) { | 4531 if (_newSources.isEmpty) { |
| 4532 return false; | 4532 return false; |
| 4533 } | 4533 } |
| 4534 currentTarget = _newSources.removeLast(); | 4534 currentTarget = _newSources.removeLast(); |
| 4535 return true; | 4535 return true; |
| 4536 } | 4536 } |
| 4537 } | 4537 } |
| OLD | NEW |