From: Luca Bruno Date: Tue, 24 Aug 2010 08:52:05 +0000 (+0200) Subject: girparser: Skip creating structs for *Class and *Iface X-Git-Tag: 0.11.2~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1af8ec2579627267f67cfb026f5b3f311de92bd;p=thirdparty%2Fvala.git girparser: Skip creating structs for *Class and *Iface --- diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 2c132fd9a..86b332b06 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -541,34 +541,6 @@ public class Vala.GirParser : CodeVisitor { next (); parse_repository (); - var remove_queue = new ArrayList (); - - 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); - remove_queue.add (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); - remove_queue.add (iface_struct); - } - } - } - - foreach (CodeNode node in remove_queue) { - source_file.remove_node (node); - } - reader = null; this.current_source_file = null; } @@ -1206,7 +1178,7 @@ public class Vala.GirParser : CodeVisitor { return type; } - Struct parse_record () { + Struct? parse_record () { start_element ("record"); var st = new Struct (reader.get_attribute ("name"), get_current_src ()); st.external = true; @@ -1242,6 +1214,13 @@ public class Vala.GirParser : CodeVisitor { } } end_element ("record"); + + if (current_gtype_struct_for != null) { + // skip *Class or *Iface + current_gtype_struct_for = null; + return null; + } + return st; }