From: Rico Tzschichholz Date: Thu, 23 Nov 2017 21:15:55 +0000 (+0100) Subject: Parameter-names are not mandatory X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a10b789e8468dc058567d5baeedac225af671524;p=thirdparty%2Fvala.git Parameter-names are not mandatory --- diff --git a/dbusgen/valadbusparser.vala b/dbusgen/valadbusparser.vala index cf5fe3a6d..2872317e1 100644 --- a/dbusgen/valadbusparser.vala +++ b/dbusgen/valadbusparser.vala @@ -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");