Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1395853004: FYI: add strong mode checking to error verifier's task (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: format Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 12 matching lines...) Expand all
23 import 'package:analyzer/src/generated/source.dart'; 23 import 'package:analyzer/src/generated/source.dart';
24 import 'package:analyzer/src/generated/visitors.dart'; 24 import 'package:analyzer/src/generated/visitors.dart';
25 import 'package:analyzer/src/plugin/engine_plugin.dart'; 25 import 'package:analyzer/src/plugin/engine_plugin.dart';
26 import 'package:analyzer/src/services/lint.dart'; 26 import 'package:analyzer/src/services/lint.dart';
27 import 'package:analyzer/src/task/driver.dart'; 27 import 'package:analyzer/src/task/driver.dart';
28 import 'package:analyzer/src/task/general.dart'; 28 import 'package:analyzer/src/task/general.dart';
29 import 'package:analyzer/src/task/html.dart'; 29 import 'package:analyzer/src/task/html.dart';
30 import 'package:analyzer/src/task/inputs.dart'; 30 import 'package:analyzer/src/task/inputs.dart';
31 import 'package:analyzer/src/task/model.dart'; 31 import 'package:analyzer/src/task/model.dart';
32 import 'package:analyzer/src/task/strong_mode.dart'; 32 import 'package:analyzer/src/task/strong_mode.dart';
33 import 'package:analyzer/src/task/strong/checker.dart';
34 import 'package:analyzer/src/task/strong/rules.dart';
33 import 'package:analyzer/task/dart.dart'; 35 import 'package:analyzer/task/dart.dart';
34 import 'package:analyzer/task/general.dart'; 36 import 'package:analyzer/task/general.dart';
35 import 'package:analyzer/task/model.dart'; 37 import 'package:analyzer/task/model.dart';
36 38
37 /** 39 /**
38 * The [ResultCachingPolicy] for ASTs. 40 * The [ResultCachingPolicy] for ASTs.
39 */ 41 */
40 const ResultCachingPolicy AST_CACHING_POLICY = 42 const ResultCachingPolicy AST_CACHING_POLICY =
41 const SimpleResultCachingPolicy(8192, 8192); 43 const SimpleResultCachingPolicy(8192, 8192);
42 44
(...skipping 4164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4207 // 4209 //
4208 // Use the ErrorVerifier to compute errors. 4210 // Use the ErrorVerifier to compute errors.
4209 // 4211 //
4210 ErrorVerifier errorVerifier = new ErrorVerifier( 4212 ErrorVerifier errorVerifier = new ErrorVerifier(
4211 errorReporter, 4213 errorReporter,
4212 libraryElement, 4214 libraryElement,
4213 typeProvider, 4215 typeProvider,
4214 new InheritanceManager(libraryElement), 4216 new InheritanceManager(libraryElement),
4215 context.analysisOptions.enableSuperMixins); 4217 context.analysisOptions.enableSuperMixins);
4216 unit.accept(errorVerifier); 4218 unit.accept(errorVerifier);
4219
4220 // TODO(jmesserly): this should move into its own task!
4221 // TODO(jmesserly): this is not just verifiying the unit, it is also doing
4222 // some type inference.
4223 if (context.analysisOptions.strongMode) {
4224 unit.accept(new CodeChecker(new TypeRules(typeProvider), errorListener));
4225 }
4226
4217 // 4227 //
4218 // Record outputs. 4228 // Record outputs.
4219 // 4229 //
4220 outputs[VERIFY_ERRORS] = removeDuplicateErrors(errorListener.errors); 4230 outputs[VERIFY_ERRORS] = removeDuplicateErrors(errorListener.errors);
4221 } 4231 }
4222 4232
4223 /** 4233 /**
4224 * Check each directive in the given [unit] to see if the referenced source 4234 * Check each directive in the given [unit] to see if the referenced source
4225 * exists and report an error if it does not. 4235 * exists and report an error if it does not.
4226 */ 4236 */
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
4398 4408
4399 @override 4409 @override
4400 bool moveNext() { 4410 bool moveNext() {
4401 if (_newSources.isEmpty) { 4411 if (_newSources.isEmpty) {
4402 return false; 4412 return false;
4403 } 4413 }
4404 currentTarget = _newSources.removeLast(); 4414 currentTarget = _newSources.removeLast();
4405 return true; 4415 return true;
4406 } 4416 }
4407 } 4417 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698