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

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

Issue 1507933002: Refactor strong mode to remove duplicate TypeRules (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
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/checker.dart'; 32 import 'package:analyzer/src/task/strong/checker.dart';
33 import 'package:analyzer/src/task/strong/rules.dart';
34 import 'package:analyzer/src/task/strong_mode.dart'; 33 import 'package:analyzer/src/task/strong_mode.dart';
35 import 'package:analyzer/task/dart.dart'; 34 import 'package:analyzer/task/dart.dart';
36 import 'package:analyzer/task/general.dart'; 35 import 'package:analyzer/task/general.dart';
37 import 'package:analyzer/task/model.dart'; 36 import 'package:analyzer/task/model.dart';
38 37
39 /** 38 /**
40 * The [ResultCachingPolicy] for ASTs. 39 * The [ResultCachingPolicy] for ASTs.
41 */ 40 */
42 const ResultCachingPolicy AST_CACHING_POLICY = 41 const ResultCachingPolicy AST_CACHING_POLICY =
43 const SimpleResultCachingPolicy(8192, 8192); 42 const SimpleResultCachingPolicy(8192, 8192);
(...skipping 4956 matching lines...) Expand 10 before | Expand all | Expand 10 after
5000 4999
5001 @override 5000 @override
5002 void internalPerform() { 5001 void internalPerform() {
5003 RecordingErrorListener errorListener = new RecordingErrorListener(); 5002 RecordingErrorListener errorListener = new RecordingErrorListener();
5004 // 5003 //
5005 // Prepare inputs. 5004 // Prepare inputs.
5006 // 5005 //
5007 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); 5006 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
5008 CompilationUnit unit = getRequiredInput(UNIT_INPUT); 5007 CompilationUnit unit = getRequiredInput(UNIT_INPUT);
5009 if (context.analysisOptions.strongMode) { 5008 if (context.analysisOptions.strongMode) {
5010 unit.accept(new CodeChecker(new TypeRules(typeProvider), errorListener)); 5009 unit.accept(new CodeChecker(
5010 typeProvider, new StrongTypeSystemImpl(), errorListener));
5011 } 5011 }
5012 5012
5013 // 5013 //
5014 // Record outputs. 5014 // Record outputs.
5015 // 5015 //
5016 outputs[STRONG_MODE_ERRORS] = getUniqueErrors(errorListener.errors); 5016 outputs[STRONG_MODE_ERRORS] = getUniqueErrors(errorListener.errors);
5017 outputs[RESOLVED_UNIT] = unit; 5017 outputs[RESOLVED_UNIT] = unit;
5018 } 5018 }
5019 5019
5020 /** 5020 /**
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
5266 5266
5267 @override 5267 @override
5268 bool moveNext() { 5268 bool moveNext() {
5269 if (_newSources.isEmpty) { 5269 if (_newSources.isEmpty) {
5270 return false; 5270 return false;
5271 } 5271 }
5272 currentTarget = _newSources.removeLast(); 5272 currentTarget = _newSources.removeLast();
5273 return true; 5273 return true;
5274 } 5274 }
5275 } 5275 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/type_system.dart ('k') | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698