]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vapigen: Add support for base types and ranks in structs
authorEvan Nemerson <evan@coeus-group.com>
Sun, 20 Dec 2009 05:58:36 +0000 (21:58 -0800)
committerJürg Billeter <j@bitron.ch>
Mon, 25 Jan 2010 09:40:54 +0000 (10:40 +0100)
Fixes bug 605039.

vala/valastruct.vala
vapigen/valagidlparser.vala

index 49177f240b060723f42e4430557e7253b526f694..63b8b8542476e0c8d8b7fd41a94e00a4ea7ab6db 100644 (file)
@@ -403,6 +403,15 @@ public class Vala.Struct : TypeSymbol {
                return rank;
        }
 
+       /**
+        * Sets the rank of this integer or floating point type.
+        *
+        * @return the rank if this is an integer or floating point type
+        */
+       public void set_rank (int rank) {
+               this.rank = rank;
+       }
+
        private void process_ccode_attribute (Attribute a) {
                if (a.has_argument ("const_cname")) {
                        set_const_cname (a.get_string ("const_cname"));
index 010c82ffbacf2a23e4e719890ce026e917239425..246dd18f5062509d650f45969f29d1cf154ffce4 100644 (file)
@@ -425,6 +425,10 @@ public class Vala.GIdlParser : CodeVisitor {
                                                        if (eval (nv[1]) == "1") {
                                                                return;
                                                        }
+                                               } else if (nv[0] == "base_type") {
+                                                       st.base_type = parse_type_string (eval (nv[1]));
+                                               } else if (nv[0] == "rank") {
+                                                       st.set_rank (eval (nv[1]).to_int ());
                                                } else if (nv[0] == "simple_type") {
                                                        if (eval (nv[1]) == "1") {
                                                                st.set_simple_type (true);