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

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

Issue 2060013002: Refactor strong mode to use standard Analyzer errors (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix hasImplicitCasts on the CompilationUnit Created 4 years, 6 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
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/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 5664 matching lines...) Expand 10 before | Expand all | Expand 10 after
5675 @override 5675 @override
5676 void internalPerform() { 5676 void internalPerform() {
5677 RecordingErrorListener errorListener = new RecordingErrorListener(); 5677 RecordingErrorListener errorListener = new RecordingErrorListener();
5678 // 5678 //
5679 // Prepare inputs. 5679 // Prepare inputs.
5680 // 5680 //
5681 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); 5681 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
5682 CompilationUnit unit = getRequiredInput(UNIT_INPUT); 5682 CompilationUnit unit = getRequiredInput(UNIT_INPUT);
5683 AnalysisOptionsImpl options = context.analysisOptions; 5683 AnalysisOptionsImpl options = context.analysisOptions;
5684 if (options.strongMode) { 5684 if (options.strongMode) {
5685 unit.accept(new CodeChecker( 5685 CodeChecker checker = new CodeChecker(
5686 typeProvider, new StrongTypeSystemImpl(), errorListener, 5686 typeProvider,
5687 options)); 5687 new StrongTypeSystemImpl(implicitCasts: options.implicitCasts),
5688 errorListener,
5689 options);
5690 checker.visitCompilationUnit(unit);
5688 } 5691 }
5689 // 5692 //
5690 // Record outputs. 5693 // Record outputs.
5691 // 5694 //
5692 outputs[STRONG_MODE_ERRORS] = getUniqueErrors(errorListener.errors); 5695 outputs[STRONG_MODE_ERRORS] = getUniqueErrors(errorListener.errors);
5693 outputs[CREATED_RESOLVED_UNIT] = true; 5696 outputs[CREATED_RESOLVED_UNIT] = true;
5694 outputs[RESOLVED_UNIT] = unit; 5697 outputs[RESOLVED_UNIT] = unit;
5695 } 5698 }
5696 5699
5697 /** 5700 /**
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
5988 5991
5989 @override 5992 @override
5990 bool moveNext() { 5993 bool moveNext() {
5991 if (_newSources.isEmpty) { 5994 if (_newSources.isEmpty) {
5992 return false; 5995 return false;
5993 } 5996 }
5994 currentTarget = _newSources.removeLast(); 5997 currentTarget = _newSources.removeLast();
5995 return true; 5998 return true;
5996 } 5999 }
5997 } 6000 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698