diff options
author | Jim Carroll <thecarrolls@jiminger.com> | 2012-10-21 17:58:17 -0400 |
---|---|---|
committer | Jim Carroll <thecarrolls@jiminger.com> | 2012-10-21 20:22:38 -0400 |
commit | 423f351d543b455f9e6be031a055c9be0f4851c7 (patch) | |
tree | a9f8b0bda1454b36bd6d4ae891ddf73e27d2ebf8 /tools/codegenerator/Helper.groovy | |
parent | 8c3043fad1aac26c1094d199c8d101c88f1036fc (diff) |
[fix] handle multiple entries on the knownapitypes feature line.
Diffstat (limited to 'tools/codegenerator/Helper.groovy')
-rw-r--r-- | tools/codegenerator/Helper.groovy | 10 |
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) |