[vala/switch-to-gir-clutter: 1/2] girparser: Add errordomain metadata



commit 63498d002ee89c4a21275d0f578fad137ad43298
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Jul 7 22:52:39 2011 +0200

    girparser: Add errordomain metadata

 vala/valagirparser.vala |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index b64f2dd..9b014e1 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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 ();



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