]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support `hidden' attribute for boxed types and `type_arguments' attribute
authorJuerg Billeter <j@bitron.ch>
Thu, 29 May 2008 15:09:39 +0000 (15:09 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Thu, 29 May 2008 15:09:39 +0000 (15:09 +0000)
2008-05-29  Juerg Billeter  <j@bitron.ch>

* vapigen/valagidlparser.vala:

Support `hidden' attribute for boxed types and `type_arguments'
attribute for fields and properties, patch by Ali Sabil

svn path=/trunk/; revision=1484

ChangeLog
vapigen/valagidlparser.vala

index 0ee87f39345a3beab7045dc73d79da83bd5fe574..f60c44458adf443cec10fcbca46d34e480c12ffe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-29  Jürg Billeter  <j@bitron.ch>
+
+       * vapigen/valagidlparser.vala:
+
+       Support `hidden' attribute for boxed types and `type_arguments'
+       attribute for fields and properties, patch by Ali Sabil
+
 2008-05-29  Jürg Billeter  <j@bitron.ch>
 
        * vala/valainterface.vala:
index d4985eeb5f30c12b2aa7e475ba4e94859c37019a..a04850abd3408ffe4c361ab4aa6a99fbebd9b8d0 100644 (file)
@@ -608,12 +608,22 @@ public class Vala.GIdlParser : CodeVisitor {
                        current_data_type = null;
                }
        }
-       
+
        private void parse_boxed (IdlNodeBoxed boxed_node, Namespace ns, IdlModule module) {
                weak IdlNode node = (IdlNode) boxed_node;
-       
+
                string name = fix_type_name (node.name, ns);
 
+               var node_attributes = get_attributes (node.name);
+               if (node_attributes != null) {
+                       foreach (string attr in node_attributes) {
+                               var nv = attr.split ("=", 2);
+                               if (nv[0] == "hidden") {
+                                       return;
+                               }
+                       }
+               }
+
                if (!is_reference_type (node.name)) {
                        var st = ns.scope.lookup (name) as Struct;
                        if (st == null) {
@@ -1566,6 +1576,13 @@ public class Vala.GIdlParser : CodeVisitor {
                                        if (eval (nv[1]) == "1") {
                                                return null;
                                        }
+                               } else if (nv[0] == "type_arguments") {
+                                       var type_args = eval (nv[1]).split (",");
+                                       foreach (string type_arg in type_args) {
+                                               var arg_type = new UnresolvedType.from_symbol (new UnresolvedSymbol (null, type_arg));
+                                               arg_type.value_owned = true;
+                                               prop.property_type.add_type_argument (arg_type);
+                                       }
                                }
                        }
                }
@@ -1632,6 +1649,13 @@ public class Vala.GIdlParser : CodeVisitor {
                                        }
                                } else if (nv[0] == "type_name") {
                                        ((UnresolvedType) type).unresolved_symbol = new UnresolvedSymbol (null, eval (nv[1]));
+                               } else if (nv[0] == "type_arguments") {
+                                       var type_args = eval (nv[1]).split (",");
+                                       foreach (string type_arg in type_args) {
+                                               var arg_type = new UnresolvedType.from_symbol (new UnresolvedSymbol (null, type_arg));
+                                               arg_type.value_owned = true;
+                                               type.add_type_argument (arg_type);
+                                       }
                                }
                        }
                }