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 'dart:uri'; | 7 import 'dart:uri'; |
8 | 8 |
9 import 'elements.dart'; | 9 import 'elements.dart'; |
10 import '../../compiler.dart' as api; | 10 import '../../compiler.dart' as api; |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 getImplementationLibrary().addMember(element, listener); | 498 getImplementationLibrary().addMember(element, listener); |
499 } else { | 499 } else { |
500 getLibrary().addMember(element, listener); | 500 getLibrary().addMember(element, listener); |
501 } | 501 } |
502 } | 502 } |
503 | 503 |
504 void setPartOf(PartOf tag, DiagnosticListener listener) { | 504 void setPartOf(PartOf tag, DiagnosticListener listener) { |
505 LibraryElementX library = enclosingElement; | 505 LibraryElementX library = enclosingElement; |
506 if (library.entryCompilationUnit == this) { | 506 if (library.entryCompilationUnit == this) { |
507 listener.reportMessage( | 507 listener.reportMessage( |
508 listener.spanFromNode(tag), | 508 listener.spanFromSpannable(tag), |
509 MessageKind.ILLEGAL_DIRECTIVE.error(), | 509 MessageKind.ILLEGAL_DIRECTIVE.error(), |
510 api.Diagnostic.WARNING); | 510 api.Diagnostic.WARNING); |
511 return; | 511 return; |
512 } | 512 } |
513 if (!localMembers.isEmpty) { | 513 if (!localMembers.isEmpty) { |
514 listener.reportMessage( | 514 listener.reportMessage( |
515 listener.spanFromNode(tag), | 515 listener.spanFromSpannable(tag), |
516 MessageKind.BEFORE_TOP_LEVEL.error(), | 516 MessageKind.BEFORE_TOP_LEVEL.error(), |
517 api.Diagnostic.ERROR); | 517 api.Diagnostic.ERROR); |
518 return; | 518 return; |
519 } | 519 } |
520 if (partTag != null) { | 520 if (partTag != null) { |
521 listener.reportMessage( | 521 listener.reportMessage( |
522 listener.spanFromNode(tag), | 522 listener.spanFromSpannable(tag), |
523 MessageKind.DUPLICATED_PART_OF.error(), | 523 MessageKind.DUPLICATED_PART_OF.error(), |
524 api.Diagnostic.WARNING); | 524 api.Diagnostic.WARNING); |
525 return; | 525 return; |
526 } | 526 } |
527 partTag = tag; | 527 partTag = tag; |
528 LibraryName libraryTag = getLibrary().libraryTag; | 528 LibraryName libraryTag = getLibrary().libraryTag; |
529 if (libraryTag != null) { | 529 if (libraryTag != null) { |
530 String expectedName = tag.name.toString(); | 530 String expectedName = tag.name.toString(); |
531 String actualName = libraryTag.name.toString(); | 531 String actualName = libraryTag.name.toString(); |
532 if (expectedName != actualName) { | 532 if (expectedName != actualName) { |
533 listener.reportMessage( | 533 listener.reportMessage( |
534 listener.spanFromNode(tag.name), | 534 listener.spanFromSpannable(tag.name), |
535 MessageKind.LIBRARY_NAME_MISMATCH.error([expectedName]), | 535 MessageKind.LIBRARY_NAME_MISMATCH.error([expectedName]), |
536 api.Diagnostic.WARNING); | 536 api.Diagnostic.WARNING); |
537 } | 537 } |
538 } | 538 } |
539 } | 539 } |
540 | 540 |
541 bool get hasMembers => !localMembers.isEmpty; | 541 bool get hasMembers => !localMembers.isEmpty; |
542 } | 542 } |
543 | 543 |
544 class LibraryElementX extends ScopeContainerElementX implements LibraryElement { | 544 class LibraryElementX extends ScopeContainerElementX implements LibraryElement { |
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 | 1857 |
1858 MetadataAnnotation ensureResolved(Compiler compiler) { | 1858 MetadataAnnotation ensureResolved(Compiler compiler) { |
1859 if (resolutionState == STATE_NOT_STARTED) { | 1859 if (resolutionState == STATE_NOT_STARTED) { |
1860 compiler.resolver.resolveMetadataAnnotation(this); | 1860 compiler.resolver.resolveMetadataAnnotation(this); |
1861 } | 1861 } |
1862 return this; | 1862 return this; |
1863 } | 1863 } |
1864 | 1864 |
1865 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1865 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
1866 } | 1866 } |
OLD | NEW |