Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial structure for cpg native queries and and a small example #865

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Sort, more magic
KuechA committed Jun 21, 2024
commit c760aa69160fc55202b42663ff17fd9aa80e8229
Original file line number Diff line number Diff line change
@@ -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("<", "&lt;").replace(">", "&gt;").replace("[]", "Array")))
parametersContent += formatter.format("parameter", param.description, mapOf("name" to param.name, "type" to param.type.name.toString().replace("<", "&lt;").replace(">", &gt;").replace("[]", "Array")))
}

if(parametersContent.isEmpty()) parametersContent = " "
@@ -406,7 +406,7 @@ class TSFIInformationExtractor : InformationExtractor() {
}else{
nameString = node.name.toString()
}
return nameString.replace("<", "&lt;").replace(">", "&gt;")
return nameString.replace("<", "-lt-").replace(">", "-gt-")
}

private fun replaceSFName(name:String): String{