]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Make PropertyAccessorType a flag to correctly handle its possible states
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 25 Mar 2014 20:31:18 +0000 (21:31 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 25 Mar 2014 20:31:18 +0000 (21:31 +0100)
src/driver/0.16.x/treebuilder.vala
src/driver/0.18.x/treebuilder.vala
src/driver/0.20.x/treebuilder.vala
src/driver/0.22.x/treebuilder.vala
src/driver/0.24.x/treebuilder.vala
src/driver/0.26.x/treebuilder.vala
src/libvaladoc/api/propertyaccessor.vala
src/libvaladoc/api/propertyaccessortype.vala

index b993a64c7bfbf09c758be5fbd444d5d725b72c83..54458a12b02601225139ae282b33201054a1e762 100644 (file)
@@ -579,6 +579,9 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
 
        private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
                if (element.construction) {
+                       if (element.writable) {
+                               return (PropertyAccessorType.CONSTRUCT | PropertyAccessorType.SET);
+                       }
                        return PropertyAccessorType.CONSTRUCT;
                } else if (element.writable) {
                        return PropertyAccessorType.SET;
index a7d7b449b3a71834bacec249e6a6b141a18e08d7..43ec86038b1faf8c1c99fd3ee093df1299fecb2a 100644 (file)
@@ -580,6 +580,9 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
 
        private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
                if (element.construction) {
+                       if (element.writable) {
+                               return (PropertyAccessorType.CONSTRUCT | PropertyAccessorType.SET);
+                       }
                        return PropertyAccessorType.CONSTRUCT;
                } else if (element.writable) {
                        return PropertyAccessorType.SET;
index 970f12c86e62959b18fe34c73db021e81646f8fe..06c5845642a9a2a17e16ed77b0ea41408cb4a166 100644 (file)
@@ -585,6 +585,9 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
 
        private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
                if (element.construction) {
+                       if (element.writable) {
+                               return (PropertyAccessorType.CONSTRUCT | PropertyAccessorType.SET);
+                       }
                        return PropertyAccessorType.CONSTRUCT;
                } else if (element.writable) {
                        return PropertyAccessorType.SET;
index cfc8c912ae6f40744d8cb8385ada32e3afb1deb5..32f9b849ca146a97baf8b289dc918c390a2162ef 100644 (file)
@@ -585,6 +585,9 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
 
        private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
                if (element.construction) {
+                       if (element.writable) {
+                               return (PropertyAccessorType.CONSTRUCT | PropertyAccessorType.SET);
+                       }
                        return PropertyAccessorType.CONSTRUCT;
                } else if (element.writable) {
                        return PropertyAccessorType.SET;
index 1b5d0dc8f127641e8767a6f9c915d3d286c5f82b..72107114404e3e430dadd57a038aeb3476b6271c 100644 (file)
@@ -585,6 +585,9 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
 
        private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
                if (element.construction) {
+                       if (element.writable) {
+                               return (PropertyAccessorType.CONSTRUCT | PropertyAccessorType.SET);
+                       }
                        return PropertyAccessorType.CONSTRUCT;
                } else if (element.writable) {
                        return PropertyAccessorType.SET;
index 6dfae9194a34346482ceb71ab4ae009aedd92ee9..32197d5d6725b1d678b62cded91478f0eb45b5e3 100644 (file)
@@ -585,6 +585,9 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
 
        private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
                if (element.construction) {
+                       if (element.writable) {
+                               return (PropertyAccessorType.CONSTRUCT | PropertyAccessorType.SET);
+                       }
                        return PropertyAccessorType.CONSTRUCT;
                } else if (element.writable) {
                        return PropertyAccessorType.SET;
index 8c2855549d3e282859f7246262ea3bb8328dbe0e..0a79dd3fcc9ff5d528ac94abefb8b195d20b74b2 100644 (file)
@@ -67,7 +67,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol {
         */
        public bool is_construct {
                get {
-                       return type == PropertyAccessorType.CONSTRUCT;
+                       return (type & PropertyAccessorType.CONSTRUCT) != 0;
                }
        }
 
@@ -76,7 +76,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol {
         */
        public bool is_set {
                get {
-                       return type == PropertyAccessorType.SET;
+                       return (type & PropertyAccessorType.SET) != 0;
                }
        }
 
@@ -85,7 +85,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol {
         */
        public bool is_get {
                get {
-                       return type == PropertyAccessorType.GET;
+                       return (type & PropertyAccessorType.GET) != 0;
                }
        }
 
index 01529caf427f7412022c504321e7b521e25a7377..609815ae052a21d830f6a8ff987527509db5701c 100644 (file)
  */
 
 public enum Valadoc.Api.PropertyAccessorType {
-       CONSTRUCT,
-       SET,
-       GET;
+       CONSTRUCT = 1 << 0,
+       SET = 1 << 1,
+       GET = 1 << 2;
 
        public string to_string () {
-               switch (this) {
-               case PropertyAccessorType.CONSTRUCT:
+               if ((this & PropertyAccessorType.CONSTRUCT) != 0) {
+                       if ((this & PropertyAccessorType.SET) != 0) {
+                               return "construct set";
+                       }
                        return "construct";
-
-               case PropertyAccessorType.SET:
+               } else if ((this & PropertyAccessorType.SET) != 0) {
                        return "set";
-
-               case PropertyAccessorType.GET:
+               } else if ((this & PropertyAccessorType.GET) != 0) {
                        return "get";
                }