aboutsummaryrefslogtreecommitdiff
path: root/find-modules
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2017-01-14 21:42:50 +0000
committerStephen Kelly <steveire@gmail.com>2017-01-15 11:18:34 +0000
commit8c347c61abafa68e247ff4664ae658cfa15af932 (patch)
tree972eca5ade46d3a0c213d854f6f8acfe1881a3d2 /find-modules
parent3c31028dad2f9c53bea6630fd0da127a6da0d610 (diff)
downloadextra-cmake-modules-8c347c61abafa68e247ff4664ae658cfa15af932.tar.gz
extra-cmake-modules-8c347c61abafa68e247ff4664ae658cfa15af932.tar.bz2
Bindings: Use lists in function API instead of strings
Custom rules should be able to deal with lists in these cases. This is already the case for function parameters.
Diffstat (limited to 'find-modules')
-rwxr-xr-xfind-modules/rules_engine.py8
-rw-r--r--find-modules/sip_generator.py11
2 files changed, 12 insertions, 7 deletions
diff --git a/find-modules/rules_engine.py b/find-modules/rules_engine.py
index 64ce1d97..34bd15dc 100755
--- a/find-modules/rules_engine.py
+++ b/find-modules/rules_engine.py
@@ -224,7 +224,10 @@ class ContainerRuleDb(AbstractCompiledRuleDb):
:return: Modifying rule or None (even if a rule matched, it may not modify things).
"""
parents = _parents(container)
- matcher, rule = self._match(parents, sip["name"], sip["template_parameters"], sip["decl"], sip["base_specifiers"])
+ matcher, rule = self._match(parents, sip["name"],
+ ", ".join(sip["template_parameters"]),
+ sip["decl"],
+ ", ".join(sip["base_specifiers"]))
if matcher:
before = deepcopy(sip)
rule.fn(container, sip, matcher)
@@ -882,6 +885,9 @@ def function_discard_impl(container, function, sip, matcher):
def typedef_discard(container, typedef, sip, matcher):
sip["name"] = ""
+def discard_QSharedData_base(container, sip, matcher):
+ sip["base_specifiers"].remove("QSharedData")
+
def rules(project_rules):
"""
Constructor.
diff --git a/find-modules/sip_generator.py b/find-modules/sip_generator.py
index a8c164b5..41dd6369 100644
--- a/find-modules/sip_generator.py
+++ b/find-modules/sip_generator.py
@@ -345,9 +345,9 @@ class SipGenerator(object):
#
# Flesh out the SIP context for the rules engine.
#
- sip["template_parameters"] = ", ".join(template_type_parameters)
+ sip["template_parameters"] = template_type_parameters
sip["decl"] = container_type
- sip["base_specifiers"] = ", ".join(base_specifiers)
+ sip["base_specifiers"] = base_specifiers
sip["body"] = body
modifying_rule = self.rules.container_rules().apply(container, sip)
pad = " " * (level * 4)
@@ -364,11 +364,11 @@ class SipGenerator(object):
body = pad + "// Discarded {} (by {})\n".format(SipGenerator.describe(container), "/External/ handling")
else:
if sip["base_specifiers"]:
- decl += ": " + sip["base_specifiers"]
+ decl += ": " + ", ".join(sip["base_specifiers"])
if sip["annotations"]:
decl += " /" + ",".join(sip["annotations"]) + "/"
if sip["template_parameters"]:
- decl = pad + "template <" + sip["template_parameters"] + ">\n" + decl
+ decl = pad + "template <" + ", ".join(sip["template_parameters"]) + ">\n" + decl
decl += "\n" + pad + "{\n"
decl += "%TypeHeaderCode\n#include <{}>\n%End\n".format(include_filename)
body = decl + sip["body"] + pad + "};\n"
@@ -511,13 +511,12 @@ class SipGenerator(object):
if parameter_modifying_rules:
decl += pad
- sip["template_parameters"] = ", ".join(sip["template_parameters"])
decl += sip["name"] + "(" + ", ".join(sip["parameters"]) + ")"
if sip["fn_result"]:
decl = sip["fn_result"] + " " + decl
decl = pad + sip["prefix"] + decl + sip["suffix"]
if sip["template_parameters"]:
- decl = pad + "template <" + sip["template_parameters"] + ">\n" + decl
+ decl = pad + "template <" + ", ".join(sip["template_parameters"]) + ">\n" + decl
decl += ";\n"
decl += sip["code"]
else: