From: Evan Nemerson Date: Sun, 20 Dec 2009 05:58:36 +0000 (-0800) Subject: vapigen: Add support for base types and ranks in structs X-Git-Tag: 0.7.10~61 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=115c6c59f5fea078d2b3000e1eef035b5f47bfcd;p=thirdparty%2Fvala.git vapigen: Add support for base types and ranks in structs Fixes bug 605039. --- diff --git a/vala/valastruct.vala b/vala/valastruct.vala index 49177f240..63b8b8542 100644 --- a/vala/valastruct.vala +++ b/vala/valastruct.vala @@ -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")); diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index 010c82ffb..246dd18f5 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -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);