diff options
author | Jürg Billeter <j@bitron.ch> | 2008-10-24 16:25:18 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-10-24 16:25:18 +0000 |
commit | 120f332bee157f2501e857b45bf440102eeffdf8 (patch) | |
tree | 1ce31e86b48fa8828a9830c097eab88e9a6c31ce /vapigen | |
parent | 4e94cd2aab3be05325596d4e659142bb08b9b56e (diff) | |
download | vala-120f332bee157f2501e857b45bf440102eeffdf8.tar.gz |
Remove Class and Iface structs
2008-10-24 Jürg Billeter <j@bitron.ch>
* vala/valanamespace.vala:
* vapigen/valagirparser.vala:
Remove Class and Iface structs
svn path=/trunk/; revision=1901
Diffstat (limited to 'vapigen')
-rw-r--r-- | vapigen/valagirparser.vala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vapigen/valagirparser.vala b/vapigen/valagirparser.vala index 12d851dc8..89d3b0d6a 100644 --- a/vapigen/valagirparser.vala +++ b/vapigen/valagirparser.vala @@ -66,6 +66,28 @@ public class Vala.GirParser : CodeVisitor { 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; } |