Chromium Code Reviews| 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 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 Loading... | |
| 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.elements.forEach((SourceString _, Element element) { |
|
ahe
2012/03/10 19:45:41
I think this would lead to re-exporting imported e
ngeoffray
2012/03/10 20:57:32
Good point. Done.
| |
| 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 } |
| OLD | NEW |