summaryrefslogtreecommitdiff
path: root/vala/valacreationmethod.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-06-05 09:58:56 +0200
committerJürg Billeter <j@bitron.ch>2010-06-05 10:12:11 +0200
commite4284d3bad686502882e681d2bfa88d6a196fa9d (patch)
treed28855ec2476d4d636a985952c73269d0068ecff /vala/valacreationmethod.vala
parent642b48d5be8440121f33629a41f9251be7c888f5 (diff)
downloadvala-e4284d3bad686502882e681d2bfa88d6a196fa9d.tar.gz
dova: Do not use infix for creation methods of basic types
Diffstat (limited to 'vala/valacreationmethod.vala')
-rw-r--r--vala/valacreationmethod.vala17
1 files changed, 16 insertions, 1 deletions
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 {