[vala/staging] girparser: Apply explicitly given ctype metadata attributes on callables



commit 6feaa3b8e4157f5e7ca6e824d9e03e302579b6ab
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Jan 18 17:58:42 2020 +0100

    girparser: Apply explicitly given ctype metadata attributes on callables

 vala/valagirparser.vala | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index f30d8b0d5..6719d8e08 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3130,6 +3130,11 @@ public class Vala.GirParser : CodeVisitor {
                        symbol_type = element_name;
                }
 
+               string? ctype = null;
+               if (metadata.has_argument (ArgumentType.CTYPE)) {
+                       ctype = metadata.get_string (ArgumentType.CTYPE);
+               }
+
                string name = current.name;
                string throws_string = reader.get_attribute ("throws");
                string invoker = reader.get_attribute ("invoker");
@@ -3287,6 +3292,10 @@ public class Vala.GirParser : CodeVisitor {
                }
                current.return_array_length_idx = return_array_length_idx;
 
+               if (ctype != null) {
+                       s.set_attribute_string ("CCode", "type", ctype);
+               }
+
                current.symbol = s;
 
                if (metadata.has_argument (ArgumentType.FINISH_NAME)) {


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