]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Accept function in record, boxed, union, enumeration
authorJürg Billeter <j@bitron.ch>
Mon, 15 Aug 2011 14:12:31 +0000 (16:12 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 15 Aug 2011 14:20:57 +0000 (16:20 +0200)
Used by gobject-introspection 1.29.17+. This commit ignores the
function elements but they could replace our own static method
detection in the future.

vala/valagirparser.vala

index 847efb8cdef88803c84a4c29d2fcf5730ed7a912..c44070574e04a2db30aef982b056a463a72bd67e 100644 (file)
@@ -1935,6 +1935,8 @@ public class Vala.GirParser : CodeVisitor {
                                        parse_enumeration_member ();
                                        calculate_common_prefix (ref common_prefix, old_current.get_cname ());
                                }
+                       } else if (reader.name == "function") {
+                               skip_element ();
                        } else {
                                // error
                                Report.error (get_current_src (), "unknown child element `%s' in `%s'".printf (reader.name, element_name));
@@ -2304,6 +2306,8 @@ public class Vala.GirParser : CodeVisitor {
                                parse_constructor ();
                        } else if (reader.name == "method") {
                                parse_method ("method");
+                       } else if (reader.name == "function") {
+                               skip_element ();
                        } else if (reader.name == "union") {
                                parse_union ();
                        } else {
@@ -2750,6 +2754,8 @@ public class Vala.GirParser : CodeVisitor {
                                parse_constructor ();
                        } else if (reader.name == "method") {
                                parse_method ("method");
+                       } else if (reader.name == "function") {
+                               skip_element ();
                        } else if (reader.name == "union") {
                                parse_union ();
                        } else {
@@ -2792,6 +2798,8 @@ public class Vala.GirParser : CodeVisitor {
                                parse_constructor ();
                        } else if (reader.name == "method") {
                                parse_method ("method");
+                       } else if (reader.name == "function") {
+                               skip_element ();
                        } else if (reader.name == "record") {
                                parse_record ();
                        } else {