vala r1901 - in trunk: . vala vapigen



Author: juergbi
Date: Fri Oct 24 16:25:18 2008
New Revision: 1901
URL: http://svn.gnome.org/viewvc/vala?rev=1901&view=rev

Log:
2008-10-24  JÃrg Billeter  <j bitron ch>

	* vala/valanamespace.vala:
	* vapigen/valagirparser.vala:

	Remove Class and Iface structs


Modified:
   trunk/ChangeLog
   trunk/vala/valanamespace.vala
   trunk/vapigen/valagirparser.vala

Modified: trunk/vala/valanamespace.vala
==============================================================================
--- trunk/vala/valanamespace.vala	(original)
+++ trunk/vala/valanamespace.vala	Fri Oct 24 16:25:18 2008
@@ -166,6 +166,16 @@
 		structs.add (st);
 		scope.add (st.name, st);
 	}
+	
+	/**
+	 * Removes the specified struct from this namespace.
+	 *
+	 * @param st a struct
+	 */
+	public void remove_struct (Struct st) {
+		structs.remove (st);
+		scope.remove (st.name);
+	}
 			
 	/**
 	 * Adds the specified enum to this namespace.

Modified: trunk/vapigen/valagirparser.vala
==============================================================================
--- trunk/vapigen/valagirparser.vala	(original)
+++ trunk/vapigen/valagirparser.vala	Fri Oct 24 16:25:18 2008
@@ -66,6 +66,28 @@
 		next ();
 		parse_repository ();
 
+		foreach (CodeNode node in source_file.get_nodes ()) {
+			if (node is Class) {
+				var cl = (Class) node;
+				var ns = cl.parent_symbol as Namespace;
+				// remove Class records
+				var class_struct = ns.scope.lookup (cl.name + "Class") as Struct;
+				if (class_struct != null) {
+					ns.remove_struct ((Struct) class_struct);
+					source_file.remove_node (class_struct);
+				}
+			} else if (node is Interface) {
+				var iface = (Interface) node;
+				var ns = iface.parent_symbol as Namespace;
+				// remove Iface records
+				var iface_struct = ns.scope.lookup (iface.name + "Iface") as Struct;
+				if (iface_struct != null) {
+					ns.remove_struct ((Struct) iface_struct);
+					source_file.remove_node (iface_struct);
+				}
+			}
+		}
+
 		reader = null;
 		this.current_source_file = null;
 	}



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