[vala] dova: Support list concatenation



commit f919d8bee8fba296deba59f62522c4952477c5f0
Author: Jürg Billeter <j bitron ch>
Date:   Sat Jun 5 09:56:49 2010 +0200

    dova: Support list concatenation

 vala/valabinaryexpression.vala |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index bc4965f..ebb19f8 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -282,7 +282,16 @@ public class Vala.BinaryExpression : Expression {
 			} else {
 				value_type.value_owned = true;
 			}
-		} else if (left.value_type is ArrayType && operator == BinaryOperator.PLUS) {
+		} else if (analyzer.context.profile == Profile.DOVA && left.value_type.data_type == analyzer.list_type.data_type
+		    && operator == BinaryOperator.PLUS) {
+			// list concatenation
+
+			var concat_call = new MethodCall (new MemberAccess (left, "concat"));
+			concat_call.add_argument (right);
+			concat_call.target_type = target_type;
+			parent_node.replace_expression (this, concat_call);
+			return concat_call.check (analyzer);
+		} else if (analyzer.context.profile != Profile.DOVA && left.value_type is ArrayType && operator == BinaryOperator.PLUS) {
 			// array concatenation
 
 			var array_type = (ArrayType) left.value_type;



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