aboutsummaryrefslogtreecommitdiff
path: root/tools/codegenerator/Helper.groovy
diff options
context:
space:
mode:
authorJim Carroll <thecarrolls@jiminger.com>2012-10-21 17:58:17 -0400
committerJim Carroll <thecarrolls@jiminger.com>2012-10-21 20:22:38 -0400
commit423f351d543b455f9e6be031a055c9be0f4851c7 (patch)
treea9f8b0bda1454b36bd6d4ae891ddf73e27d2ebf8 /tools/codegenerator/Helper.groovy
parent8c3043fad1aac26c1094d199c8d101c88f1036fc (diff)
[fix] handle multiple entries on the knownapitypes feature line.
Diffstat (limited to 'tools/codegenerator/Helper.groovy')
-rw-r--r--tools/codegenerator/Helper.groovy10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/codegenerator/Helper.groovy b/tools/codegenerator/Helper.groovy
index ff619355ef..737eeee597 100644
--- a/tools/codegenerator/Helper.groovy
+++ b/tools/codegenerator/Helper.groovy
@@ -678,10 +678,14 @@ public class Helper
{
String rootType = SwigTypeParser.getRootType(type)
String namespace = findNamespace(searchFrom,'::',false)
- return hasFeatureSetting(type,searchFrom,'feature_knownapitypes',{ it.split(',').find(
+ String lastMatch = null
+ hasFeatureSetting(type,searchFrom,'feature_knownapitypes',{ it.split(',').find(
{
if (it.trim() == rootType)
+ {
+ lastMatch = rootType
return true
+ }
// we assume the 'type' is defined within namespace and
// so we can walk up the namespace appending the type until
// we find a match.
@@ -689,13 +693,17 @@ public class Helper
{
// System.out.println('checking ' + (namespace + '::' + rootType))
if ((namespace + '::' + rootType) == it.trim())
+ {
+ lastMatch = it.trim()
return true
+ }
// truncate the last namespace
int chop = namespace.lastIndexOf('::')
namespace = (chop > 0) ? namespace.substring(0,chop) : ''
}
return false
}) != null })
+ return lastMatch
}
private static String hasFeatureSetting(String type, Node searchFrom, String feature, Closure test)