in Sources/MockoloFramework/Utils/TypeParser.swift [482:511]
func parseBrackets(_ arg: String, type: BracketType) -> String {
var left = ""
var right = ""
switch type {
case .angle:
left = "<"
right = ">"
case .square:
left = "["
right = "]"
}
var mutableArg = arg
var nextRange: Range<String.Index>? = nil
while let leftRange = mutableArg.range(of: left, options: .caseInsensitive, range: nextRange, locale: nil),
let rightRange = mutableArg.range(of: right, options: .caseInsensitive, range: nextRange, locale: nil) {
let bound = leftRange.lowerBound..<rightRange.lowerBound
let sub = mutableArg[bound]
let newsub = sub.replacingOccurrences(of: ",", with: ";")
mutableArg = mutableArg.replacingOccurrences(of: sub, with: newsub)
if let nextIdx = mutableArg.index(rightRange.upperBound, offsetBy: 1, limitedBy: mutableArg.endIndex) {
nextRange = nextIdx..<mutableArg.endIndex
} else {
break
}
}
return mutableArg
}