[vala/0.44] girparser: Detect and replace "-" in parameter names
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.44] girparser: Detect and replace "-" in parameter names
- Date: Thu, 7 Nov 2019 11:19:22 +0000 (UTC)
commit 998d2e9568884f903000ef3d3695e9011d0b58de
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Oct 22 18:42:16 2019 +0200
girparser: Detect and replace "-" in parameter names
... to avoid generating bindings with invalid syntax.
vala/valagirparser.vala | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 9a47de56c..eff753b24 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -2484,6 +2484,9 @@ public class Vala.GirParser : CodeVisitor {
}
if (name == null) {
name = default_name;
+ } else if (name.contains ("-")) {
+ Report.warning (get_current_src (), "parameter name contains hyphen");
+ name = name.replace ("-", "_");
}
string direction = null;
if (metadata.has_argument (ArgumentType.OUT)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]