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; |
1554 // | 1557 // |
1555 // Validate that the part source is unique in the library. | 1558 // Validate that the part source is unique in the library. |
1556 // | 1559 // |
1557 if (!seenPartSources.add(partSource)) { | 1560 if (!seenPartSources.add(partSource)) { |
1558 errors.add(new AnalysisError( | 1561 errors.add(new AnalysisError( |
1559 librarySource, | 1562 librarySource, |
1560 partUri.offset, | 1563 partUri.offset, |
1561 partUri.length, | 1564 partUri.length, |
1562 CompileTimeErrorCode.DUPLICATE_PART, | 1565 CompileTimeErrorCode.DUPLICATE_PART, |
1563 [partSource.uri])); | 1566 [partSource.uri])); |
(...skipping 4305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5869 | 5872 |
5870 @override | 5873 @override |
5871 bool moveNext() { | 5874 bool moveNext() { |
5872 if (_newSources.isEmpty) { | 5875 if (_newSources.isEmpty) { |
5873 return false; | 5876 return false; |
5874 } | 5877 } |
5875 currentTarget = _newSources.removeLast(); | 5878 currentTarget = _newSources.removeLast(); |
5876 return true; | 5879 return true; |
5877 } | 5880 } |
5878 } | 5881 } |
OLD | NEW |