Commit 76e1657d authored by Mathias Hasselmann's avatar Mathias Hasselmann Committed by Mathias Hasselmann
Browse files

generate "throws" clause when needed

2007-08-14  Mathias Hasselmann  <mathias.hasselmann@gmx.de>

	* vala/valainterfacewriter.vala:
	generate "throws" clause when needed

svn path=/trunk/; revision=467
parent 39331557
2007-08-14 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* vala/valainterfacewriter.vala:
generate "throws" clause when needed
2007-08-14 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* gobject/valaccodecompiler.vala: do not pass non-existant
......
......@@ -337,9 +337,26 @@ public class Vala.InterfaceWriter : CodeVisitor {
write_newline ();
}
private void write_error_domains (Collection<TypeReference> error_domains) {
if (error_domains.size > 0) {
write_string (" throws ");
bool first = true;
foreach (TypeReference type in error_domains) {
if (!first) {
write_string (", ");
} else {
first = false;
}
write_type (type);
}
}
}
private void write_params (Collection<FormalParameter> params) {
write_string ("(");
bool first = true;
foreach (FormalParameter param in params) {
if (!first) {
......@@ -373,7 +390,7 @@ public class Vala.InterfaceWriter : CodeVisitor {
write_string (param.default_expression.to_string ());
}
}
write_string (")");
}
......@@ -487,8 +504,9 @@ public class Vala.InterfaceWriter : CodeVisitor {
}
write_string (" ");
write_params (m.get_parameters ());
write_error_domains (m.get_error_domains ());
write_string (";");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment