From c760aa69160fc55202b42663ff17fd9aa80e8229 Mon Sep 17 00:00:00 2001 From: Alexander Kuechler Date: Fri, 21 Jun 2024 11:45:24 +0200 Subject: [PATCH] Sort, more magic --- .../cpg/native/TSFIInformationExtractor.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt b/codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt index 7cb8545f1..75b416006 100644 --- a/codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt +++ b/codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt @@ -352,12 +352,12 @@ class TSFIInformationExtractor : InformationExtractor() { override fun formatTSFIInformation(formatter: Formatter): String { var xml = "" - for (tsfi in tsfiDeclarations){ + for (tsfi in tsfiDeclarations.sortedBy { getComplexName(it.annotated) }) { var tsfiContent = formatter.format("description", tsfi.description, mapOf()) var parametersContent = "" for(param in tsfi.params){ - parametersContent += formatter.format("parameter", param.description, mapOf("name" to param.name, "type" to param.type.name.toString().replace("<", "<").replace(">", ">").replace("[]", "Array"))) + parametersContent += formatter.format("parameter", param.description, mapOf("name" to param.name, "type" to param.type.name.toString().replace("<", "<").replace(">", >").replace("[]", "Array"))) } if(parametersContent.isEmpty()) parametersContent = " " @@ -406,7 +406,7 @@ class TSFIInformationExtractor : InformationExtractor() { }else{ nameString = node.name.toString() } - return nameString.replace("<", "<").replace(">", ">") + return nameString.replace("<", "-lt-").replace(">", "-gt-") } private fun replaceSFName(name:String): String{