in Sources/SwiftCodeSanKit/Utils/Extensions/SyntaxExtensions.swift [955:1012]
func declMetadatas(path: String, module: String, encloser: String, description: String, imports: [String]) -> [DeclMetadata] {
var list = [DeclMetadata]()
for binding in bindings {
if let idpattern = binding.pattern.as(IdentifierPatternSyntax.self) {
let id = idpattern.identifier.text
if id == "_" { continue }
let ty = binding.type
let full = id + "_" + ty
let bound = binding.boundTypes(isTransparent: isTransparent)
let val = DeclMetadata(path: path,
module: module,
imports: imports,
encloser: encloser,
name: id,
type: ty,
fullName: full,
description: description,
declType: declType,
inheritedTypes: inheritedTypes,
boundTypes: bound,
boundTypesAL: bound,
isPublicOrOpen: accessLevel.isPublicOrOpen,
isOverride: isOverride,
used: false)
list.append(val)
} else if let tuple = binding.pattern.as(TuplePatternSyntax.self) {
for el in tuple.elements {
if let idpattern = el.pattern.as(IdentifierPatternSyntax.self) {
let id = idpattern.identifier.text
if id == "_" { continue }
let ty = binding.type
let full = id + "_" + ty
let bound = binding.boundTypes(isTransparent: isTransparent)
let val = DeclMetadata(path: path,
module: module,
imports: imports,
encloser: encloser,
name: id,
type: ty,
fullName: full,
description: description,
declType: declType,
inheritedTypes: inheritedTypes,
boundTypes: bound,
boundTypesAL: bound,
isPublicOrOpen: accessLevel.isPublicOrOpen,
isOverride: isOverride,
used: false)
list.append(val)
}
}
}
}
return list
}