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

Unified Diff: frog/leg/scanner/scanner_task.dart

Issue 9642001: Make string juxtaposition combine properly with string interpolations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments so far. 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 side-by-side diff with in-line comments
Download patch
Index: frog/leg/scanner/scanner_task.dart
diff --git a/frog/leg/scanner/scanner_task.dart b/frog/leg/scanner/scanner_task.dart
index b0071dce2faebe37d84ffa2e6388f23d9db19e3f..94740f822ed55128eb14e5b2060fc70c00ab7f47 100644
--- a/frog/leg/scanner/scanner_task.dart
+++ b/frog/leg/scanner/scanner_task.dart
@@ -23,8 +23,10 @@ class ScannerTask extends CompilerTask {
Uri cwd = new Uri(scheme: 'file', path: compiler.currentDirectory);
Uri base = cwd.resolve(library.script.name.toString());
for (ScriptTag tag in library.tags.reverse()) {
- SourceString argument = tag.argument.value.copyWithoutQuotes(1, 1);
- Uri resolved = base.resolve(argument.slowToString());
+ StringNode argument = tag.argument;
+ // TODO(lrn): When supporting (compile-time constant) interpolations,
ahe 2012/03/19 15:53:06 This TODO seems confused. We do not support compil
Lasse Reichstein Nielsen 2012/03/20 09:34:33 Reworded.
+ // find a way to convert them to a string here.
+ Uri resolved = base.resolve(argument.dartString.slowToString());
ahe 2012/03/19 15:53:06 FWIW, I like not having to call copyWithoutQuotes!
if (tag.isImport()) {
// It is not safe to import other libraries at this point as
// another library could then observe the current library
@@ -53,8 +55,8 @@ class ScannerTask extends CompilerTask {
for (ScriptTag tag in imports.toLink()) {
// Now that we have processed all the source tags, it is safe to
// start loading other libraries.
- SourceString argument = tag.argument.value.copyWithoutQuotes(1, 1);
- Uri resolved = base.resolve(argument.slowToString());
+ StringNode argument = tag.argument;
+ Uri resolved = base.resolve(argument.dartString.slowToString());
if (resolved.toString() == "dart:core") {
implicitlyImportCoreLibrary = false;
}
@@ -104,7 +106,8 @@ class ScannerTask extends CompilerTask {
void importLibrary(LibraryElement library, LibraryElement imported,
ScriptTag tag) {
if (tag !== null && tag.prefix !== null) {
- SourceString prefix = tag.prefix.dartString.source;
+ SourceString prefix =
+ new SourceString(tag.prefix.dartString.slowToString());
ahe 2012/03/19 15:53:06 Something to consider: having a method named asSou
Lasse Reichstein Nielsen 2012/03/20 09:34:33 We do have that (dartString.source), but it includ
ahe 2012/03/20 10:23:01 Perhaps. I'm not sure what the specification says,
Element e = library.find(prefix);
if (e === null) {
e = new PrefixElement(prefix, library);

Powered by Google App Engine
This is Rietveld 408576698