| 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(() { |
| 11 scanElements(compilationUnit); | 11 scanElements(compilationUnit); |
| 12 if (compilationUnit.kind === ElementKind.LIBRARY) { | 12 if (compilationUnit.kind === ElementKind.LIBRARY) { |
| 13 processScriptTags(compilationUnit); | 13 processScriptTags(compilationUnit); |
| 14 } | 14 } |
| 15 native.processNativeClasses(compiler, compilationUnit); |
| 15 }); | 16 }); |
| 16 } | 17 } |
| 17 | 18 |
| 18 void processScriptTags(LibraryElement library) { | 19 void processScriptTags(LibraryElement library) { |
| 19 LinkBuilder<ScriptTag> imports = new LinkBuilder<ScriptTag>(); | 20 LinkBuilder<ScriptTag> imports = new LinkBuilder<ScriptTag>(); |
| 20 Uri cwd = new Uri(scheme: 'file', path: compiler.currentDirectory); | 21 Uri cwd = new Uri(scheme: 'file', path: compiler.currentDirectory); |
| 21 Uri base = cwd.resolve(library.script.name.toString()); | 22 Uri base = cwd.resolve(library.script.name.toString()); |
| 22 for (ScriptTag tag in library.tags.reverse()) { | 23 for (ScriptTag tag in library.tags.reverse()) { |
| 23 SourceString argument = tag.argument.value.copyWithoutQuotes(1, 1); | 24 SourceString argument = tag.argument.value.copyWithoutQuotes(1, 1); |
| 24 Uri resolved = base.resolve(argument.toString()); | 25 Uri resolved = base.resolve(argument.toString()); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } else { | 106 } else { |
| 106 for (Link<Element> link = imported.topLevelElements; !link.isEmpty(); | 107 for (Link<Element> link = imported.topLevelElements; !link.isEmpty(); |
| 107 link = link.tail) { | 108 link = link.tail) { |
| 108 compiler.withCurrentElement(link.head, () { | 109 compiler.withCurrentElement(link.head, () { |
| 109 library.define(link.head, compiler); | 110 library.define(link.head, compiler); |
| 110 }); | 111 }); |
| 111 } | 112 } |
| 112 } | 113 } |
| 113 } | 114 } |
| 114 } | 115 } |
| OLD | NEW |