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 'elements.dart'; | 7 import 'elements.dart'; |
8 import '../../compiler.dart' as api; | 8 import '../../compiler.dart' as api; |
9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 if (enclosingElement.isPatch) { | 599 if (enclosingElement.isPatch) { |
600 getImplementationLibrary().addMember(element, listener); | 600 getImplementationLibrary().addMember(element, listener); |
601 } else { | 601 } else { |
602 getLibrary().addMember(element, listener); | 602 getLibrary().addMember(element, listener); |
603 } | 603 } |
604 } | 604 } |
605 | 605 |
606 void setPartOf(PartOf tag, DiagnosticListener listener) { | 606 void setPartOf(PartOf tag, DiagnosticListener listener) { |
607 LibraryElementX library = enclosingElement; | 607 LibraryElementX library = enclosingElement; |
608 if (library.entryCompilationUnit == this) { | 608 if (library.entryCompilationUnit == this) { |
609 listener.reportMessage( | 609 listener.reportError(tag, MessageKind.ILLEGAL_DIRECTIVE); |
610 listener.spanFromSpannable(tag), | |
611 MessageKind.ILLEGAL_DIRECTIVE.error(), | |
612 api.Diagnostic.WARNING); | |
613 return; | 610 return; |
614 } | 611 } |
615 if (!localMembers.isEmpty) { | 612 if (!localMembers.isEmpty) { |
616 listener.reportError(tag, MessageKind.BEFORE_TOP_LEVEL); | 613 listener.reportError(tag, MessageKind.BEFORE_TOP_LEVEL); |
617 return; | 614 return; |
618 } | 615 } |
619 if (partTag != null) { | 616 if (partTag != null) { |
620 listener.reportMessage( | 617 listener.reportMessage( |
621 listener.spanFromSpannable(tag), | 618 listener.spanFromSpannable(tag), |
622 MessageKind.DUPLICATED_PART_OF.error(), | 619 MessageKind.DUPLICATED_PART_OF.error(), |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2477 | 2474 |
2478 MetadataAnnotation ensureResolved(Compiler compiler) { | 2475 MetadataAnnotation ensureResolved(Compiler compiler) { |
2479 if (resolutionState == STATE_NOT_STARTED) { | 2476 if (resolutionState == STATE_NOT_STARTED) { |
2480 compiler.resolver.resolveMetadataAnnotation(this); | 2477 compiler.resolver.resolveMetadataAnnotation(this); |
2481 } | 2478 } |
2482 return this; | 2479 return this; |
2483 } | 2480 } |
2484 | 2481 |
2485 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2482 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
2486 } | 2483 } |
OLD | NEW |