[vala/wip/dbusgen: 30/40] Parameter-names are not mandatory
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/dbusgen: 30/40] Parameter-names are not mandatory
- Date: Wed, 19 Sep 2018 13:33:27 +0000 (UTC)
commit 5a57a6e93b2aa52904e972f89f1c1137caf834d4
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Nov 23 22:15:55 2017 +0100
Parameter-names are not mandatory
dbusgen/valadbusparser.vala | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
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");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]