2008-10-24 Jürg Billeter <j@bitron.ch>
* vapigen/valagirparser.vala:
Support methods throwing errors
svn path=/trunk/; revision=1906
+2008-10-24 Jürg Billeter <j@bitron.ch>
+
+ * vapigen/valagirparser.vala:
+
+ Support methods throwing errors
+
2008-10-24 Jürg Billeter <j@bitron.ch>
* vapigen/valagirparser.vala:
MarkupReader reader;
CodeContext context;
+ Namespace glib_ns;
SourceFile current_source_file;
SourceLocation begin;
*/
public void parse (CodeContext context) {
this.context = context;
+ glib_ns = context.root.scope.lookup ("GLib") as Namespace;
context.accept (this);
}
Method parse_method () {
start_element ("method");
string name = reader.get_attribute ("name");
+ string throws_string = reader.get_attribute ("throws");
next ();
DataType return_type;
if (current_token == MarkupTokenType.START_ELEMENT && reader.name == "return-value") {
}
end_element ("parameters");
}
+ if (throws_string == "1") {
+ m.add_error_type (new ErrorType (null));
+ }
end_element ("method");
return m;
}