]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Support specifying struct=false for records
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 11 Aug 2011 20:18:27 +0000 (22:18 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Thu, 11 Aug 2011 20:35:48 +0000 (22:35 +0200)
vala/valagirparser.vala

index c2ef7ef5f93f1423c61d1f9f84e123def728ca69..847efb8cdef88803c84a4c29d2fcf5730ed7a912 100644 (file)
@@ -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 ();