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

Unified Diff: lib/compiler/implementation/scanner/scanner_task.dart

Issue 10827448: Support sourceing files in patches. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Refactor. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/patch_parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/scanner/scanner_task.dart
diff --git a/lib/compiler/implementation/scanner/scanner_task.dart b/lib/compiler/implementation/scanner/scanner_task.dart
index 25793e774c993f9cb0d23a0c13d0d24d8eb33a77..182fead08241514bd337828cedf26eb0c202feab 100644
--- a/lib/compiler/implementation/scanner/scanner_task.dart
+++ b/lib/compiler/implementation/scanner/scanner_task.dart
@@ -58,10 +58,7 @@ class ScannerTask extends CompilerTask {
}
} else if (tag.isSource()) {
tagState = checkTag(TagState.SOURCE, tag);
- Script script = compiler.readScript(resolved, tag);
- CompilationUnitElement unit =
- new CompilationUnitElement(script, library);
- compiler.withCurrentElement(unit, () => scan(unit));
+ compiler.scanner.sourceTagInLibrary(tag, resolved, library);
} else if (tag.isResource()) {
tagState = checkTag(TagState.RESOURCE, tag);
compiler.reportWarning(tag, 'ignoring resource tag');
@@ -88,6 +85,16 @@ class ScannerTask extends CompilerTask {
}
/**
+ * Source a tag in the scope of [library]. The [path] given is used as is,
Mads Ager (google) 2012/08/22 07:40:03 Handle a source tag in the scope of [library]? At
Anders Johnsen 2012/08/22 13:02:27 Done.
+ * any resolve should be done beforehand.
Mads Ager (google) 2012/08/22 07:40:03 any resolution
Anders Johnsen 2012/08/22 13:02:27 Done.
+ */
+ void sourceTagInLibrary(ScriptTag tag, Uri path, LibraryElement library) {
Mads Ager (google) 2012/08/22 07:40:03 Rename. sourceScript? importSourceFromTag (to matc
Anders Johnsen 2012/08/22 13:02:27 Done.
+ Script script = compiler.readScript(path, tag);
+ CompilationUnitElement unit = new CompilationUnitElement(script, library);
+ compiler.withCurrentElement(unit, () => compiler.scanner.scan(unit));
+ }
+
+ /**
* Handle an import script tag by importing the referenced library into the
* current library.
* Returns the resolved library [Uri].
« no previous file with comments | « lib/compiler/implementation/patch_parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698