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/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 if (directive is LibraryDirective) { | 1544 if (directive is LibraryDirective) { |
1545 libraryNameNode = directive.name; | 1545 libraryNameNode = directive.name; |
1546 directivesToResolve.add(directive); | 1546 directivesToResolve.add(directive); |
1547 } else if (directive is PartDirective) { | 1547 } else if (directive is PartDirective) { |
1548 StringLiteral partUri = directive.uri; | 1548 StringLiteral partUri = directive.uri; |
1549 Source partSource = directive.uriSource; | 1549 Source partSource = directive.uriSource; |
1550 hasPartDirective = true; | 1550 hasPartDirective = true; |
1551 CompilationUnit partUnit = partUnitMap[partSource]; | 1551 CompilationUnit partUnit = partUnitMap[partSource]; |
1552 if (partUnit != null) { | 1552 if (partUnit != null) { |
1553 CompilationUnitElementImpl partElement = partUnit.element; | 1553 CompilationUnitElementImpl partElement = partUnit.element; |
1554 partElement.uriOffset = partUri.offset; | |
1555 partElement.uriEnd = partUri.end; | |
1556 partElement.uri = directive.uriContent; | |
1557 // | 1554 // |
1558 // Validate that the part source is unique in the library. | 1555 // Validate that the part source is unique in the library. |
1559 // | 1556 // |
1560 if (!seenPartSources.add(partSource)) { | 1557 if (!seenPartSources.add(partSource)) { |
1561 errors.add(new AnalysisError( | 1558 errors.add(new AnalysisError( |
1562 librarySource, | 1559 librarySource, |
1563 partUri.offset, | 1560 partUri.offset, |
1564 partUri.length, | 1561 partUri.length, |
1565 CompileTimeErrorCode.DUPLICATE_PART, | 1562 CompileTimeErrorCode.DUPLICATE_PART, |
1566 [partSource.uri])); | 1563 [partSource.uri])); |
(...skipping 4304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5871 | 5868 |
5872 @override | 5869 @override |
5873 bool moveNext() { | 5870 bool moveNext() { |
5874 if (_newSources.isEmpty) { | 5871 if (_newSources.isEmpty) { |
5875 return false; | 5872 return false; |
5876 } | 5873 } |
5877 currentTarget = _newSources.removeLast(); | 5874 currentTarget = _newSources.removeLast(); |
5878 return true; | 5875 return true; |
5879 } | 5876 } |
5880 } | 5877 } |
OLD | NEW |