]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Add out/ref arguments
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 29 Aug 2010 13:35:12 +0000 (15:35 +0200)
committerEvan Nemerson <evan@coeus-group.com>
Mon, 8 Nov 2010 09:43:19 +0000 (01:43 -0800)
vala/valagirparser.vala

index fddfc203c08c613470d3f9a1ab11f03c9a8aa1c8..dfb27df070dd90cdfcf7c3242b01347da860748d 100644 (file)
@@ -1540,7 +1540,18 @@ public class Vala.GirParser : CodeVisitor {
                if (name == null) {
                        name = default_name;
                }
-               string direction = reader.get_attribute ("direction");
+               string direction = null;
+               if (metadata.has_argument (ArgumentType.OUT)) {
+                       if (metadata.get_bool (ArgumentType.OUT)) {
+                               direction = "out";
+                       } // null otherwise
+               } else if (metadata.has_argument (ArgumentType.REF)) {
+                       if (metadata.get_bool (ArgumentType.REF)) {
+                               direction = "inout";
+                       } // null otherwise
+               } else {
+                       direction = reader.get_attribute ("direction");
+               }
                string transfer = reader.get_attribute ("transfer-ownership");
                string allow_none = reader.get_attribute ("allow-none");