]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dova: Do not use infix for creation methods of basic types
authorJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 07:58:56 +0000 (09:58 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 08:12:11 +0000 (10:12 +0200)
vala/valacreationmethod.vala

index 8bcaecfa1539b04091f1dbeef1d2a46082a5778f..09c3733c01db634c157ee070fc0a080bc2733cad 100644 (file)
@@ -97,7 +97,18 @@ public class Vala.CreationMethod : Method {
                var parent = parent_symbol as TypeSymbol;
 
                string infix = "new";
-               if (parent is Struct) {
+               var st = parent as Struct;
+               if (st != null) {
+                       if (CodeContext.get ().profile == Profile.DOVA) {
+                               if (st.is_boolean_type () || st.is_integer_type () || st.is_floating_type ()) {
+                                       // don't use any infix for basic types
+                                       if (name == ".new") {
+                                               return parent.get_lower_case_cname ();
+                                       } else {
+                                               return "%s%s".printf (parent.get_lower_case_cprefix (), name);
+                                       }
+                               }
+                       }
                        infix = "init";
                }
 
@@ -122,6 +133,10 @@ public class Vala.CreationMethod : Method {
 
                string infix = "construct";
 
+               if (CodeContext.get ().profile == Profile.DOVA) {
+                       infix = "init";
+               }
+
                if (name == ".new") {
                        return "%s%s".printf (parent.get_lower_case_cprefix (), infix);
                } else {