]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Parameter-names are not mandatory
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 23 Nov 2017 21:15:55 +0000 (22:15 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 29 Apr 2023 19:00:17 +0000 (21:00 +0200)
dbusgen/valadbusparser.vala

index cf5fe3a6d93f07b008b8197a0b14ce03d16fd04f..2872317e1eee3d93b47daca2a2cbf1493fd42239 100644 (file)
@@ -38,6 +38,7 @@ public class Vala.DBusParser : CodeVisitor {
        private Interface current_iface;
        private Callable current_method;
        private Parameter current_param;
+       private uint current_param_index;
        private Property current_property;
 
        private MarkupReader reader;
@@ -239,6 +240,8 @@ public class Vala.DBusParser : CodeVisitor {
        }
 
        private void parse_method_body () {
+               current_param_index = 0U;
+
                while (current_token == MarkupTokenType.START_ELEMENT) {
                        switch (reader.name) {
                                case "annotation":
@@ -309,8 +312,7 @@ public class Vala.DBusParser : CodeVisitor {
 
                string? name = reader.get_attribute ("name");
                if (name == null) {
-                       Report.error (get_current_src () , "Formal Parameters require a name attribute");
-                       return;
+                       name = "arg%u".printf (current_param_index++);
                }
 
                string? type = reader.get_attribute ("type");