]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support methods throwing errors
authorJürg Billeter <j@bitron.ch>
Fri, 24 Oct 2008 17:40:32 +0000 (17:40 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 24 Oct 2008 17:40:32 +0000 (17:40 +0000)
2008-10-24  Jürg Billeter  <j@bitron.ch>

* vapigen/valagirparser.vala:

Support methods throwing errors

svn path=/trunk/; revision=1906

ChangeLog
vapigen/valagirparser.vala

index b07e088ba4256b2c1270f19e93bb89ff57ef902e..c91e4d1089d8ace1485e34f5a0d922e6c43d7a51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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:
index 655bf6b0c77bed5c38ffe75f0fa35e01a24b4746..a6362acb225672b4a5b7856ab4c9d365941d35a4 100644 (file)
@@ -30,6 +30,7 @@ public class Vala.GirParser : CodeVisitor {
        MarkupReader reader;
 
        CodeContext context;
+       Namespace glib_ns;
 
        SourceFile current_source_file;
        SourceLocation begin;
@@ -46,6 +47,7 @@ public class Vala.GirParser : CodeVisitor {
         */
        public void parse (CodeContext context) {
                this.context = context;
+               glib_ns = context.root.scope.lookup ("GLib") as Namespace;
                context.accept (this);
        }
 
@@ -670,6 +672,7 @@ public class Vala.GirParser : CodeVisitor {
        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") {
@@ -687,6 +690,9 @@ public class Vala.GirParser : CodeVisitor {
                        }
                        end_element ("parameters");
                }
+               if (throws_string == "1") {
+                       m.add_error_type (new ErrorType (null));
+               }
                end_element ("method");
                return m;
        }