From: Jürg Billeter Date: Sat, 5 Jun 2010 07:58:56 +0000 (+0200) Subject: dova: Do not use infix for creation methods of basic types X-Git-Tag: 0.9.1~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4284d3bad686502882e681d2bfa88d6a196fa9d;p=thirdparty%2Fvala.git dova: Do not use infix for creation methods of basic types --- diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala index 8bcaecfa1..09c3733c0 100644 --- a/vala/valacreationmethod.vala +++ b/vala/valacreationmethod.vala @@ -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 {