[vala/0.44] girparser: Add support for string "ctype" metadata



commit 0d1d69dcbe4a15939823381dbebb286f2c1f44e9
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue May 7 15:44:37 2019 +0200

    girparser: Add support for string "ctype" metadata
    
    https://gitlab.gnome.org/GNOME/vala/issues/793

 vala/valagirparser.vala | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index f95c425bf..d522aa9b1 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -89,7 +89,8 @@ public class Vala.GirParser : CodeVisitor {
                NO_ACCESSOR_METHOD,
                CNAME,
                DELEGATE_TARGET,
-               LOWER_CASE_CSUFFIX;
+               LOWER_CASE_CSUFFIX,
+               CTYPE;
 
                public static ArgumentType? from_string (string name) {
                        var enum_class = (EnumClass) typeof(ArgumentType).class_ref ();
@@ -2618,7 +2619,11 @@ public class Vala.GirParser : CodeVisitor {
                        start_element ("type");
                }
 
-               ctype = reader.get_attribute("c:type");
+               if (metadata.has_argument (ArgumentType.CTYPE)) {
+                       ctype = metadata.get_string (ArgumentType.CTYPE);
+               } else {
+                       ctype = reader.get_attribute("c:type");
+               }
 
                next ();
 


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