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

Side by Side Diff: frog/leg/scanner/scanner_task.dart

Issue 9662035: When importing a library without a prefix, add the elements from the element map instead of the lis… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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
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 class ScannerTask extends CompilerTask { 5 class ScannerTask extends CompilerTask {
6 ScannerTask(Compiler compiler) : super(compiler); 6 ScannerTask(Compiler compiler) : super(compiler);
7 String get name() => 'Scanner'; 7 String get name() => 'Scanner';
8 8
9 void scan(CompilationUnitElement compilationUnit) { 9 void scan(CompilationUnitElement compilationUnit) {
10 measure(() { 10 measure(() {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 compiler.withCurrentElement(library, () => scan(library)); 98 compiler.withCurrentElement(library, () => scan(library));
99 } 99 }
100 return library; 100 return library;
101 } 101 }
102 102
103 void importLibrary(LibraryElement library, LibraryElement imported, 103 void importLibrary(LibraryElement library, LibraryElement imported,
104 LiteralString prefix) { 104 LiteralString prefix) {
105 if (prefix !== null) { 105 if (prefix !== null) {
106 library.define(new PrefixElement(prefix, imported, library), compiler); 106 library.define(new PrefixElement(prefix, imported, library), compiler);
107 } else { 107 } else {
108 for (Link<Element> link = imported.topLevelElements; !link.isEmpty(); 108 imported.forEachExport((Element element) {
109 link = link.tail) { 109 compiler.withCurrentElement(element, () {
110 compiler.withCurrentElement(link.head, () { 110 library.define(element, compiler);
111 library.define(link.head, compiler); 111 });
112 }); 112 });
113 }
114 } 113 }
115 } 114 }
116 } 115 }
117 116
118 class DietParserTask extends CompilerTask { 117 class DietParserTask extends CompilerTask {
119 DietParserTask(Compiler compiler) : super(compiler); 118 DietParserTask(Compiler compiler) : super(compiler);
120 final String name = 'Diet Parser'; 119 final String name = 'Diet Parser';
121 120
122 dietParse(CompilationUnitElement compilationUnit, Token tokens) { 121 dietParse(CompilationUnitElement compilationUnit, Token tokens) {
123 measure(() { 122 measure(() {
124 ElementListener listener = new ElementListener(compiler, compilationUnit); 123 ElementListener listener = new ElementListener(compiler, compilationUnit);
125 PartialParser parser = new PartialParser(listener); 124 PartialParser parser = new PartialParser(listener);
126 parser.parseUnit(tokens); 125 parser.parseUnit(tokens);
127 }); 126 });
128 } 127 }
129 } 128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698