]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Allow overriding of "Compact" attribute for classes
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 14 Mar 2021 07:26:42 +0000 (08:26 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 18 Mar 2021 09:07:10 +0000 (10:07 +0100)
vala/valagirparser.vala

index 71d8ccb0681bc3413d17467e4460c861f97d3092..02bc640ea2a227713ff6d160de8860e91bbcd010 100644 (file)
@@ -63,6 +63,7 @@ public class Vala.GirParser : CodeVisitor {
                VFUNC_NAME,
                VIRTUAL,
                ABSTRACT,
+               COMPACT,
                SEALED,
                SCOPE,
                STRUCT,
@@ -3521,7 +3522,11 @@ public class Vala.GirParser : CodeVisitor {
                bool require_copy_free = false;
                if (current.new_symbol) {
                        cl = new Class (current.name, current.source_reference);
-                       cl.is_compact = true;
+                       if (metadata.has_argument (ArgumentType.COMPACT)) {
+                               cl.is_compact = metadata.get_bool (ArgumentType.COMPACT);
+                       } else {
+                               cl.is_compact = true;
+                       }
                        current.symbol = cl;
                } else {
                        cl = (Class) current.symbol;