[vala] GIR parser: Support constructors throwing errors



commit 7df0f826596500cbaa34039197d2c86855571755
Author: Jürg Billeter <j bitron ch>
Date:   Thu Jul 16 12:12:41 2009 +0200

    GIR parser: Support constructors throwing errors

 vapigen/valagirparser.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/vapigen/valagirparser.vala b/vapigen/valagirparser.vala
index 820d1f6..6c04108 100644
--- a/vapigen/valagirparser.vala
+++ b/vapigen/valagirparser.vala
@@ -792,6 +792,7 @@ public class Vala.GirParser : CodeVisitor {
 	Method parse_constructor (string? parent_ctype = null) {
 		start_element ("constructor");
 		string name = reader.get_attribute ("name");
+		string throws_string = reader.get_attribute ("throws");
 		next ();
 
 		string? ctype;
@@ -814,6 +815,9 @@ public class Vala.GirParser : CodeVisitor {
 			}
 			end_element ("parameters");
 		}
+		if (throws_string == "1") {
+			m.add_error_type (new ErrorType (null, null));
+		}
 		end_element ("constructor");
 		return m;
 	}



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