[vala] GIR writer: Generate throws attribute



commit 3e2f3ff6d353936748e9d0d5a8441af618980339
Author: Didier 'Ptitjes <ptitjes free fr>
Date:   Sat Mar 21 06:05:03 2009 +0100

    GIR writer: Generate throws attribute
    
    Generate throws attribute on constructors, methods and callbacks.
    
    Signed-off-by: Didier 'Ptitjes <ptitjes free fr>
---
 gobject/valagirwriter.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/gobject/valagirwriter.vala b/gobject/valagirwriter.vala
index 53ef7eb..c6bad7a 100644
--- a/gobject/valagirwriter.vala
+++ b/gobject/valagirwriter.vala
@@ -469,6 +469,9 @@ public class Vala.GIRWriter : CodeVisitor {
 		write_indent ();
 		stream.printf ("<callback name=\"%s\"", cb.name);
 		stream.printf (" c:type=\"%s\"", cb.get_cname ());
+		if (cb.tree_can_fail) {
+			stream.printf (" throws=\"1\"");
+		}
 		stream.printf (">\n");
 		indent++;
 
@@ -514,6 +517,9 @@ public class Vala.GIRWriter : CodeVisitor {
 		} else {
 			stream.printf (" c:identifier=\"%s\"", m.get_cname ());
 		}
+		if (m.tree_can_fail) {
+			stream.printf (" throws=\"1\"");
+		}
 		stream.printf (">\n");
 		indent++;
 
@@ -542,6 +548,9 @@ public class Vala.GIRWriter : CodeVisitor {
 
 		write_indent ();
 		stream.printf ("<constructor name=\"%s\" c:identifier=\"%s\"", m.name, m.get_cname ());
+		if (m.tree_can_fail) {
+			stream.printf (" throws=\"1\"");
+		}
 		stream.printf (">\n");
 		indent++;
 



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