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

Side by Side Diff: lib/compiler/implementation/scanner/scanner_task.dart

Issue 10689038: Revert "First step towards having patch files for generic libraries." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // better way to access "dart:core". 73 // better way to access "dart:core".
74 bool implicitlyImportCoreLibrary = compiler.coreLibrary !== null; 74 bool implicitlyImportCoreLibrary = compiler.coreLibrary !== null;
75 for (ScriptTag tag in imports.toLink()) { 75 for (ScriptTag tag in imports.toLink()) {
76 // Now that we have processed all the source tags, it is safe to 76 // Now that we have processed all the source tags, it is safe to
77 // start loading other libraries. 77 // start loading other libraries.
78 StringNode argument = tag.argument; 78 StringNode argument = tag.argument;
79 Uri resolved = base.resolve(argument.dartString.slowToString()); 79 Uri resolved = base.resolve(argument.dartString.slowToString());
80 if (resolved.toString() == "dart:core") { 80 if (resolved.toString() == "dart:core") {
81 implicitlyImportCoreLibrary = false; 81 implicitlyImportCoreLibrary = false;
82 } 82 }
83 LibraryElement importedLibrary = loadLibrary(resolved, argument); 83 importLibrary(library, loadLibrary(resolved, argument), tag);
84 importLibrary(library, importedLibrary, tag);
85 if (resolved.scheme == "dart") {
86 compiler.patchDartLibrary(importedLibrary, resolved.path);
87 }
88 } 84 }
89 if (implicitlyImportCoreLibrary) { 85 if (implicitlyImportCoreLibrary) {
90 importLibrary(library, compiler.coreLibrary, null); 86 importLibrary(library, compiler.coreLibrary, null);
91 } 87 }
92 } 88 }
93 89
94 void scanElements(CompilationUnitElement compilationUnit) { 90 void scanElements(CompilationUnitElement compilationUnit) {
95 Script script = compilationUnit.script; 91 Script script = compilationUnit.script;
96 Token tokens; 92 Token tokens;
97 try { 93 try {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 static final int RESOURCE = 4; 200 static final int RESOURCE = 4;
205 201
206 /** Next state. */ 202 /** Next state. */
207 static final List<int> NEXT = 203 static final List<int> NEXT =
208 const <int>[NO_TAG_SEEN, 204 const <int>[NO_TAG_SEEN,
209 IMPORT, // Only one library tag is allowed. 205 IMPORT, // Only one library tag is allowed.
210 IMPORT, 206 IMPORT,
211 SOURCE, 207 SOURCE,
212 RESOURCE]; 208 RESOURCE];
213 } 209 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | lib/compiler/implementation/source_file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698