From: Jürg Billeter Date: Sat, 5 Jun 2010 07:44:40 +0000 (+0200) Subject: dova: Use Dova.Array as type of arrays X-Git-Tag: 0.9.1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b85afc727cd385f6ebfb67677579011f9cd4457;p=thirdparty%2Fvala.git dova: Use Dova.Array as type of arrays --- diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala index 9561a610a..be626f59d 100644 --- a/vala/valaarraytype.vala +++ b/vala/valaarraytype.vala @@ -66,7 +66,9 @@ public class Vala.ArrayType : ReferenceType { } public override Symbol? get_member (string member_name) { - if (member_name == "length") { + if (CodeContext.get ().profile == Profile.DOVA) { + return SemanticAnalyzer.symbol_lookup_inherited (CodeContext.get ().root.scope.lookup ("Dova").scope.lookup ("Array"), member_name); + } else if (member_name == "length") { return get_length_field (); } else if (member_name == "move") { return get_move_method (); @@ -152,7 +154,11 @@ public class Vala.ArrayType : ReferenceType { if (inline_allocated) { return element_type.get_cname (); } else { - return element_type.get_cname () + "*"; + if (CodeContext.get ().profile == Profile.DOVA) { + return "DovaArray*"; + } else { + return element_type.get_cname () + "*"; + } } } diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index 5e7754d32..49817386b 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -603,6 +603,14 @@ public class Vala.SemanticAnalyzer : CodeVisitor { instance_type = instance_pointer_type.base_type; } + if (CodeContext.get ().profile == Profile.DOVA) { + while (instance_type is ArrayType) { + var instance_array_type = (ArrayType) instance_type; + instance_type = new ObjectType ((Class) CodeContext.get ().root.scope.lookup ("Dova").scope.lookup ("Array")); + instance_type.add_type_argument (instance_array_type.element_type); + } + } + if (instance_type.data_type == type_symbol) { return instance_type; }