Skip to content

Commit

Permalink
girparser: Detect and replace "-" in parameter names
Browse files Browse the repository at this point in the history
... to avoid generating bindings with invalid syntax.
  • Loading branch information
ricotz committed Oct 28, 2019
1 parent b40abc3 commit 567a14f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vala/valagirparser.vala
Expand Up @@ -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)) {
Expand Down

0 comments on commit 567a14f

Please sign in to comment.