[vala] dova: Support string templates



commit 0abc1a642fca388bbecc676ef235fe7fc5e5d764
Author: Jürg Billeter <j bitron ch>
Date:   Sat Jun 5 09:47:15 2010 +0200

    dova: Support string templates

 vala/valatemplate.vala |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/vala/valatemplate.vala b/vala/valatemplate.vala
index c22fe38..90cefe0 100644
--- a/vala/valatemplate.vala
+++ b/vala/valatemplate.vala
@@ -71,11 +71,18 @@ public class Vala.Template : Expression {
 		} else {
 			expr = stringify (expression_list[0]);
 			if (expression_list.size > 1) {
-				var concat = new MethodCall (new MemberAccess (expr, "concat", source_reference), source_reference);
-				for (int i = 1; i < expression_list.size; i++) {
-					concat.add_argument (stringify (expression_list[i]));
+				if (analyzer.context.profile == Profile.DOVA) {
+					// varargs concat not yet supported
+					for (int i = 1; i < expression_list.size; i++) {
+						expr = new BinaryExpression (BinaryOperator.PLUS, expr, stringify (expression_list[i]), source_reference);
+					}
+				} else {
+					var concat = new MethodCall (new MemberAccess (expr, "concat", source_reference), source_reference);
+					for (int i = 1; i < expression_list.size; i++) {
+						concat.add_argument (stringify (expression_list[i]));
+					}
+					expr = concat;
 				}
-				expr = concat;
 			}
 		}
 		expr.target_type = target_type;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]