vala r1484 - in trunk: . vapigen



Author: juergbi
Date: Thu May 29 15:09:39 2008
New Revision: 1484
URL: http://svn.gnome.org/viewvc/vala?rev=1484&view=rev

Log:
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


Modified:
   trunk/ChangeLog
   trunk/vapigen/valagidlparser.vala

Modified: trunk/vapigen/valagidlparser.vala
==============================================================================
--- trunk/vapigen/valagidlparser.vala	(original)
+++ trunk/vapigen/valagidlparser.vala	Thu May 29 15:09:39 2008
@@ -608,12 +608,22 @@
 			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 @@
 					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 @@
 					}
 				} 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);
+					}
 				}
 			}
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]