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



commit 39eb301c548d2fccd9cd5d34f0f12622f1f5476e
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 7f4c23499..dd4e007b8 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3127,6 +3127,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");
@@ -3275,6 +3280,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]