]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Add support for NoWrapper metadata for methods
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 16 Mar 2021 14:34:02 +0000 (15:34 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 16 Mar 2021 14:34:02 +0000 (15:34 +0100)
vala/valagirparser.vala

index 3a0838dea8198fa513e713020c605ce19b002a6a..b1086b893bdac0e17b19cb87ac44c368b8d07428 100644 (file)
@@ -94,6 +94,7 @@ public class Vala.GirParser : CodeVisitor {
                DESTROY_NOTIFY_CNAME,
                FINISH_VFUNC_NAME,
                NO_ACCESSOR_METHOD,
+               NO_WRAPPER,
                CNAME,
                DELEGATE_TARGET,
                CTYPE;
@@ -3319,9 +3320,12 @@ public class Vala.GirParser : CodeVisitor {
                                } else {
                                        m.is_virtual = true;
                                }
-                               if (invoker == null && !metadata.has_argument (ArgumentType.VFUNC_NAME)) {
+                               if (metadata.has_argument (ArgumentType.NO_WRAPPER)) {
+                                       s.set_attribute ("NoWrapper", metadata.get_bool (ArgumentType.NO_WRAPPER), s.source_reference);
+                               } else if (invoker == null && !metadata.has_argument (ArgumentType.VFUNC_NAME)) {
                                        s.set_attribute ("NoWrapper", true, s.source_reference);
-                               } if (current.girdata["name"] != name) {
+                               }
+                               if (current.girdata["name"] != name) {
                                        m.set_attribute_string ("CCode", "vfunc_name", current.girdata["name"]);
                                }
                        } else if (symbol_type == "function") {