[vala/wip/girparser: 2/4] girparser: Let alias inherit more information from base_type



commit 8c9bafa0a27d1fab466b36c8e7e127c78cfe8def
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Jan 5 21:49:38 2017 +0100

    girparser: Let alias inherit more information from base_type

 vala/valagirparser.vala |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 0c02eef..5ed041a 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3594,6 +3594,7 @@ public class Vala.GirParser : CodeVisitor {
                        }
                        cl.comment = alias.comment;
                        cl.external = true;
+                       cl.is_compact = ((Class) type_sym).is_compact;
                        alias.symbol = cl;
                } else if (type_sym is Interface) {
                        // this is not a correct alias, but what can we do otherwise?
@@ -3632,6 +3633,15 @@ public class Vala.GirParser : CodeVisitor {
                        
                        alias.symbol = deleg;
                }
+
+               // inherit atributes, like type_id
+               if (type_sym is Class || (type_sym is Struct && !simple_type)) {
+                       if (type_sym.has_attribute_argument ("CCode", "has_type_id")) {
+                               alias.symbol.set_attribute_bool ("CCode", "has_type_id", 
type_sym.get_attribute_bool ("CCode", "has_type_id"));
+                       } else if (type_sym.has_attribute_argument ("CCode", "type_id")) {
+                               alias.symbol.set_attribute_string ("CCode", "type_id", 
type_sym.get_attribute_string ("CCode", "type_id"));
+                       }
+               }
        }
 
        void process_callable (Node node) {


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