OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show | 8 import '../common/resolution.dart' show |
9 Resolution, | 9 Resolution, |
10 Parsing; | 10 Parsing; |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 if (enclosingElement.isPatch) { | 778 if (enclosingElement.isPatch) { |
779 implementationLibrary.addMember(element, reporter); | 779 implementationLibrary.addMember(element, reporter); |
780 } else { | 780 } else { |
781 library.addMember(element, reporter); | 781 library.addMember(element, reporter); |
782 } | 782 } |
783 } | 783 } |
784 | 784 |
785 void setPartOf(PartOf tag, DiagnosticReporter reporter) { | 785 void setPartOf(PartOf tag, DiagnosticReporter reporter) { |
786 LibraryElementX library = enclosingElement; | 786 LibraryElementX library = enclosingElement; |
787 if (library.entryCompilationUnit == this) { | 787 if (library.entryCompilationUnit == this) { |
| 788 // This compilation unit is loaded as a library. The error is reported by |
| 789 // the library loader. |
788 partTag = tag; | 790 partTag = tag; |
789 reporter.reportErrorMessage( | |
790 tag, MessageKind.IMPORT_PART_OF); | |
791 return; | 791 return; |
792 } | 792 } |
793 if (!localMembers.isEmpty) { | 793 if (!localMembers.isEmpty) { |
794 reporter.reportErrorMessage( | 794 reporter.reportErrorMessage( |
795 tag, MessageKind.BEFORE_TOP_LEVEL); | 795 tag, MessageKind.BEFORE_TOP_LEVEL); |
796 return; | 796 return; |
797 } | 797 } |
798 if (partTag != null) { | 798 if (partTag != null) { |
799 reporter.reportWarningMessage(tag, MessageKind.DUPLICATED_PART_OF); | 799 reporter.reportWarningMessage(tag, MessageKind.DUPLICATED_PART_OF); |
800 return; | 800 return; |
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3190 AstElement get definingElement; | 3190 AstElement get definingElement; |
3191 | 3191 |
3192 bool get hasResolvedAst => definingElement.hasTreeElements; | 3192 bool get hasResolvedAst => definingElement.hasTreeElements; |
3193 | 3193 |
3194 ResolvedAst get resolvedAst { | 3194 ResolvedAst get resolvedAst { |
3195 return new ResolvedAst(declaration, | 3195 return new ResolvedAst(declaration, |
3196 definingElement.node, definingElement.treeElements); | 3196 definingElement.node, definingElement.treeElements); |
3197 } | 3197 } |
3198 | 3198 |
3199 } | 3199 } |
OLD | NEW |