[vala/switch-to-gir: 22/47] girparser: Skip private structs.



commit 8e6f64b6d2e3cd3f031695b1b1a8da766f2d2b0d
Author: Luca Bruno <lucabru src gnome org>
Date:   Tue Nov 23 21:53:43 2010 +0100

    girparser: Skip private structs.

 vala/valagirparser.vala |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index d8fdab6..a3c7ab9 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1437,7 +1437,11 @@ public class Vala.GirParser : CodeVisitor {
 				if (reader.get_attribute ("glib:get-type") != null) {
 					add_symbol_info (parse_boxed ("record"));
 				} else {
-					add_symbol_info (parse_record ());
+					if (!reader.get_attribute ("name").has_suffix ("Private")) {
+						add_symbol_info (parse_record ());
+					} else {
+						skip_element ();
+					}
 				}
 			} else if (reader.name == "class") {
 				add_symbol_info (parse_class ());
@@ -2007,9 +2011,10 @@ public class Vala.GirParser : CodeVisitor {
 					// first field is guaranteed to be the parent instance
 					skip_element ();
 				} else {
-					var field = parse_field ();
-					if (field.name != "priv") {
-						add_symbol_info (field);
+					if (reader.get_attribute ("name") != "priv") {
+						add_symbol_info (parse_field ());
+					} else {
+						skip_element ();
 					}
 				}
 				first_field = false;



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