[vala] girparser: Support specifying struct=false for records



commit b29284954fb4f0a0b6de1d0261381804e146a055
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Aug 11 22:18:27 2011 +0200

    girparser: Support specifying struct=false for records

 vala/valagirparser.vala |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index c2ef7ef..847efb8 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1820,18 +1820,22 @@ public class Vala.GirParser : CodeVisitor {
 			} else if (reader.name == "callback") {
 				parse_callback ();
 			} else if (reader.name == "record") {
-				if (reader.get_attribute ("glib:get-type") != null && !metadata.get_bool (ArgumentType.STRUCT)) {
+				if (metadata.has_argument (ArgumentType.STRUCT)) {
+					if (metadata.get_bool (ArgumentType.STRUCT)) {
+						parse_record ();
+					} else {
+						parse_boxed ("record");
+					}
+				} else if (reader.get_attribute ("glib:get-type") != null) {
 					parse_boxed ("record");
-				} else {
-					if (!reader.get_attribute ("name").has_suffix ("Private")) {
-						if (reader.get_attribute ("glib:is-gtype-struct-for") == null && reader.get_attribute ("disguised") == "1") {
-							parse_boxed ("record");
-						} else {
-							parse_record ();
-						}
+				} else if (!reader.get_attribute ("name").has_suffix ("Private")) {
+					if (reader.get_attribute ("glib:is-gtype-struct-for") == null && reader.get_attribute ("disguised") == "1") {
+						parse_boxed ("record");
 					} else {
-						skip_element ();
+						parse_record ();
 					}
+				} else {
+					skip_element ();
 				}
 			} else if (reader.name == "class") {
 				parse_class ();



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