[vala/0.46] girparser: Detect and replace "-" in parameter names
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.46] girparser: Detect and replace "-" in parameter names
- Date: Wed, 30 Oct 2019 07:44:59 +0000 (UTC)
commit 567a14f3ace583b374c6463be98f9a7a1d8e5525
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 259bf3d6c..bc2d5d7c3 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -2483,6 +2483,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]