]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dova: Support string concatenation
authorJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 07:56:33 +0000 (09:56 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 08:12:10 +0000 (10:12 +0200)
vala/valabinaryexpression.vala

index 6b579b1dde4c386c5c02322aa8e0cec32dfe71d9..bc4965f35d88548b5ea5214957de63327929f940 100644 (file)
@@ -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");