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

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

Issue 1918923003: Remove unnecessary casts and general code clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 FunctionElement entryPoint = 1375 FunctionElement entryPoint =
1376 _findEntryPoint(definingCompilationUnitElement); 1376 _findEntryPoint(definingCompilationUnitElement);
1377 List<Directive> directivesToResolve = <Directive>[]; 1377 List<Directive> directivesToResolve = <Directive>[];
1378 List<CompilationUnitElementImpl> sourcedCompilationUnits = 1378 List<CompilationUnitElementImpl> sourcedCompilationUnits =
1379 <CompilationUnitElementImpl>[]; 1379 <CompilationUnitElementImpl>[];
1380 for (Directive directive in definingCompilationUnit.directives) { 1380 for (Directive directive in definingCompilationUnit.directives) {
1381 if (directive is LibraryDirective) { 1381 if (directive is LibraryDirective) {
1382 libraryNameNode = directive.name; 1382 libraryNameNode = directive.name;
1383 directivesToResolve.add(directive); 1383 directivesToResolve.add(directive);
1384 } else if (directive is PartDirective) { 1384 } else if (directive is PartDirective) {
1385 PartDirective partDirective = directive; 1385 StringLiteral partUri = directive.uri;
1386 StringLiteral partUri = partDirective.uri; 1386 Source partSource = directive.source;
1387 Source partSource = partDirective.source;
1388 hasPartDirective = true; 1387 hasPartDirective = true;
1389 CompilationUnit partUnit = partUnitMap[partSource]; 1388 CompilationUnit partUnit = partUnitMap[partSource];
1390 if (partUnit != null) { 1389 if (partUnit != null) {
1391 CompilationUnitElementImpl partElement = partUnit.element; 1390 CompilationUnitElementImpl partElement = partUnit.element;
1392 partElement.uriOffset = partUri.offset; 1391 partElement.uriOffset = partUri.offset;
1393 partElement.uriEnd = partUri.end; 1392 partElement.uriEnd = partUri.end;
1394 partElement.uri = partDirective.uriContent; 1393 partElement.uri = directive.uriContent;
1395 // 1394 //
1396 // Validate that the part contains a part-of directive with the same 1395 // Validate that the part contains a part-of directive with the same
1397 // name as the library. 1396 // name as the library.
1398 // 1397 //
1399 if (context.exists(partSource)) { 1398 if (context.exists(partSource)) {
1400 String partLibraryName = 1399 String partLibraryName =
1401 _getPartLibraryName(partSource, partUnit, directivesToResolve); 1400 _getPartLibraryName(partSource, partUnit, directivesToResolve);
1402 if (partLibraryName == null) { 1401 if (partLibraryName == null) {
1403 errors.add(new AnalysisError( 1402 errors.add(new AnalysisError(
1404 librarySource, 1403 librarySource,
(...skipping 4145 matching lines...) Expand 10 before | Expand all | Expand 10 after
5550 5549
5551 @override 5550 @override
5552 bool moveNext() { 5551 bool moveNext() {
5553 if (_newSources.isEmpty) { 5552 if (_newSources.isEmpty) {
5554 return false; 5553 return false;
5555 } 5554 }
5556 currentTarget = _newSources.removeLast(); 5555 currentTarget = _newSources.removeLast();
5557 return true; 5556 return true;
5558 } 5557 }
5559 } 5558 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698