Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: dart/lib/compiler/implementation/elements/elements.dart

Issue 10960033: A library element should know its compilation units. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/patch_parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698