]> 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>
Sun, 14 Mar 2021 07:26:42 +0000 (08:26 +0100)
vala/valagirparser.vala

index 0235817144d0b2a6f56695ce3878ecbacf5a3fde..ddd511f240169d8b48bc2c10ba5b1746a77f149c 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.set_attribute ("Compact", true);
+                       if (metadata.has_argument (ArgumentType.COMPACT)) {
+                               cl.set_attribute ("Compact", metadata.get_bool (ArgumentType.COMPACT));
+                       } else {
+                               cl.set_attribute ("Compact", true);
+                       }
                        current.symbol = cl;
                } else {
                        cl = (Class) current.symbol;