[vala] dova: Support string concatenation



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

    dova: Support string concatenation

 vala/valabinaryexpression.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 6b579b1..bc4965f 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -262,6 +262,14 @@ public class Vala.BinaryExpression : Expression {
 		    && operator == BinaryOperator.PLUS) {
 			// string concatenation
 
+			if (analyzer.context.profile == Profile.DOVA) {
+				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);
+			}
+
 			if (right.value_type == null || right.value_type.data_type != analyzer.string_type.data_type) {
 				error = true;
 				Report.error (source_reference, "Operands must be strings");



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