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

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

Issue 10933093: Revert "Parse new library syntax." (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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 super(compilationUnit.name, 475 super(compilationUnit.name,
476 ElementKind.COMPILATION_UNIT_OVERRIDE, 476 ElementKind.COMPILATION_UNIT_OVERRIDE,
477 enclosing); 477 enclosing);
478 } 478 }
479 479
480 class LibraryElement extends ScopeContainerElement { 480 class LibraryElement extends ScopeContainerElement {
481 final Uri uri; 481 final Uri uri;
482 CompilationUnitElement entryCompilationUnit; 482 CompilationUnitElement entryCompilationUnit;
483 Link<CompilationUnitElement> compilationUnits = 483 Link<CompilationUnitElement> compilationUnits =
484 const EmptyLink<CompilationUnitElement>(); 484 const EmptyLink<CompilationUnitElement>();
485 Link<LibraryTag> tags = const EmptyLink<LibraryTag>(); 485 Link<ScriptTag> tags = const EmptyLink<ScriptTag>();
486 LibraryTag libraryTag; 486 ScriptTag libraryTag;
487 bool canUseNative = false; 487 bool canUseNative = false;
488 LibraryElement patch = null; 488 LibraryElement patch = null;
489 489
490 LibraryElement(Script script, [Uri uri]) 490 LibraryElement(Script script, [Uri uri])
491 : this.uri = ((uri === null) ? script.uri : uri), 491 : this.uri = ((uri === null) ? script.uri : uri),
492 super(new SourceString(script.name), ElementKind.LIBRARY, null) { 492 super(new SourceString(script.name), ElementKind.LIBRARY, null) {
493 entryCompilationUnit = new CompilationUnitElement(script, this); 493 entryCompilationUnit = new CompilationUnitElement(script, this);
494 } 494 }
495 495
496 496
497 bool get isPatched => patch !== null; 497 bool get isPatched => patch !== null;
498 498
499 void addCompilationUnit(CompilationUnitElement element) { 499 void addCompilationUnit(CompilationUnitElement element) {
500 compilationUnits = compilationUnits.prepend(element); 500 compilationUnits = compilationUnits.prepend(element);
501 } 501 }
502 502
503 void addTag(LibraryTag tag, DiagnosticListener listener) { 503 void addTag(ScriptTag tag, DiagnosticListener listener) {
504 tags = tags.prepend(tag); 504 tags = tags.prepend(tag);
505 } 505 }
506 506
507 /** Look up a top-level element in this library. The element could 507 /** Look up a top-level element in this library. The element could
508 * potentially have been imported from another library. Returns 508 * potentially have been imported from another library. Returns
509 * null if no such element exist. */ 509 * null if no such element exist. */
510 Element find(SourceString elementName) { 510 Element find(SourceString elementName) {
511 return localScope[elementName]; 511 return localScope[elementName];
512 } 512 }
513 513
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 1691
1692 MetadataAnnotation ensureResolved(Compiler compiler) { 1692 MetadataAnnotation ensureResolved(Compiler compiler) {
1693 if (resolutionState == STATE_NOT_STARTED) { 1693 if (resolutionState == STATE_NOT_STARTED) {
1694 compiler.resolver.resolveMetadataAnnotation(this); 1694 compiler.resolver.resolveMetadataAnnotation(this);
1695 } 1695 }
1696 return this; 1696 return this;
1697 } 1697 }
1698 1698
1699 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 1699 String toString() => 'MetadataAnnotation($value, $resolutionState)';
1700 } 1700 }
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