]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Add errordomain metadata
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 7 Jul 2011 20:52:39 +0000 (22:52 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Fri, 8 Jul 2011 16:56:36 +0000 (18:56 +0200)
vala/valagirparser.vala

index b64f2ddf4d0064c8ef2fb39f0ef8e714218d4890..9b014e14ef0568d5f66d5461ef1e01a05ed3b88c 100644 (file)
@@ -67,7 +67,8 @@ public class Vala.GirParser : CodeVisitor {
                ARRAY_LENGTH_FIELD,
                SENTINEL,
                CLOSURE,
-               CPREFIX;
+               CPREFIX,
+               ERRORDOMAIN;
 
                public static ArgumentType? from_string (string name) {
                        var enum_class = (EnumClass) typeof(ArgumentType).class_ref ();
@@ -1664,10 +1665,18 @@ public class Vala.GirParser : CodeVisitor {
                        if (reader.name == "alias") {
                                parse_alias ();
                        } else if (reader.name == "enumeration") {
-                               if (reader.get_attribute ("glib:error-quark") != null) {
-                                       parse_error_domain ();
+                               if (metadata.has_argument (ArgumentType.ERRORDOMAIN)) {
+                                       if (metadata.get_bool (ArgumentType.ERRORDOMAIN)) {
+                                               parse_error_domain ();
+                                       } else {
+                                               parse_enumeration ();
+                                       }
                                } else {
-                                       parse_enumeration ();
+                                       if (reader.get_attribute ("glib:error-quark") != null) {
+                                               parse_error_domain ();
+                                       } else {
+                                               parse_enumeration ();
+                                       }
                                }
                        } else if (reader.name == "bitfield") {
                                parse_bitfield ();