| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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'); | 5 #library('elements'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
| 10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 field.setter = accessor; | 498 field.setter = accessor; |
| 499 } | 499 } |
| 500 addToScope(field, listener); | 500 addToScope(field, listener); |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 } | 503 } |
| 504 | 504 |
| 505 class CompilationUnitElement extends ContainerElement { | 505 class CompilationUnitElement extends ContainerElement { |
| 506 final Script script; | 506 final Script script; |
| 507 | 507 |
| 508 CompilationUnitElement(Script script, Element enclosing) | 508 CompilationUnitElement(Script script, LibraryElement library) |
| 509 : this.script = script, | 509 : this.script = script, |
| 510 super(new SourceString(script.name), | 510 super(new SourceString(script.name), |
| 511 ElementKind.COMPILATION_UNIT, | 511 ElementKind.COMPILATION_UNIT, |
| 512 enclosing); | 512 library) { |
| 513 library.addCompilationUnit(this); |
| 514 } |
| 513 | 515 |
| 514 void addMember(Element element, DiagnosticListener listener) { | 516 void addMember(Element element, DiagnosticListener listener) { |
| 515 // Keep a list of top level members. | 517 // Keep a list of top level members. |
| 516 super.addMember(element, listener); | 518 super.addMember(element, listener); |
| 517 // Provide the member to the library to build scope. | 519 // Provide the member to the library to build scope. |
| 518 getLibrary().addMember(element, listener); | 520 getLibrary().addMember(element, listener); |
| 519 } | 521 } |
| 520 } | 522 } |
| 521 | 523 |
| 522 class CompilationUnitOverrideElement extends Element { | 524 class CompilationUnitOverrideElement extends Element { |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1790 | 1792 |
| 1791 MetadataAnnotation ensureResolved(Compiler compiler) { | 1793 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 1792 if (resolutionState == STATE_NOT_STARTED) { | 1794 if (resolutionState == STATE_NOT_STARTED) { |
| 1793 compiler.resolver.resolveMetadataAnnotation(this); | 1795 compiler.resolver.resolveMetadataAnnotation(this); |
| 1794 } | 1796 } |
| 1795 return this; | 1797 return this; |
| 1796 } | 1798 } |
| 1797 | 1799 |
| 1798 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1800 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 1799 } | 1801 } |
| OLD | NEW |