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

Unified Diff: frog/gen.dart

Issue 9653021: Add support for implicitly concatenating adjacent string literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added test case. 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
« no previous file with comments | « frog/analyze.dart ('k') | frog/minfrog » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/gen.dart
diff --git a/frog/gen.dart b/frog/gen.dart
index 7875b94ca79eeb32ca3f5a6b6f3178b3125e0c98..a5bde90bc77d7fd22d31adc07fb0e82803a78bf3 100644
--- a/frog/gen.dart
+++ b/frog/gen.dart
@@ -2296,6 +2296,17 @@ class MethodGenerator implements TreeVisitor, CallingContext {
}
}
+ visitStringConcatExpression(StringConcatExpression node) {
+ var items = [];
+ for (var item in node.strings) {
+ Value val = visitValue(item);
+ assert(val.type.isString);
+ items.add(val.code);
+ }
+ return new Value(world.stringType, '(${Strings.join(items, " + ")})',
+ node.span);
+ }
+
visitStringInterpExpression(StringInterpExpression node) {
var items = [];
for (var item in node.pieces) {
« no previous file with comments | « frog/analyze.dart ('k') | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698