SwiftDemangle
is a library designed for demangling Swift symbols, inspired by Swift's own swift-demangle
tool. This library offers compatibility up to Swift version 5.9, providing an easy-to-use interface for converting mangled Swift symbols into a human-readable format.
Version 5.9.1 of SwiftDemangle brings several exciting enhancements, extending support for Swift's latest 5.9 demangle grammar. Key updates include:
These additions enhance SwiftDemangle's capabilities, making it an indispensable tool for Swift developers.
# If using Swift Package Manager
dependencies: [
.package(url: "https://github.com/oozoofrog/SwiftDemangle", .upToNextMajor(from: "5.9.1"))
]
import SwiftDemangle
// Example 1: Demangling a Builtin Vector Type
let mangledVector = "_TtBv4Bf16_"
let demangledVector = SwiftDemangle.demangle(mangledVector)
print(demangledVector) // Output: Builtin.Vec4xFPIEEE16
// Example 2: Demangling a Protocol Descriptor
let mangledProtocol = "$ss6SimpleHr"
let demangledProtocol = SwiftDemangle.demangle(mangledProtocol)
print(demangledProtocol) // Output: protocol descriptor runtime record for Swift.Simple
Contributions are welcome! If you have ideas for improvements or have found a bug, please feel free to fork the repository, make changes, and submit a pull request.
SwiftDemangle is released under the Apache 2.0 License, ensuring compatibility with the original Swift swift-demangle source code's license terms. For more details, see the LICENSE file in the repository.
link |
Stars: 37 |
Last commit: 11 weeks ago |
Enhanced Demangling: Extends support to Swift 5.9 demangling syntax, covering new patterns and structures. Improved Parsing Capabilities: Enhanced parsing for various Swift symbols including Builtin types, protocol descriptors, nominal and opaque type descriptors, and more. Support for Advanced Generic Specializations: Improved parsing capabilities for complex generic specializations in Swift. Distributed Thunk and Macro Expansion: Enhanced parsing for distributed thunk and macro expansions, providing more detailed insights.
Fixes and Improvements:
This release brings our demangling capabilities up to date with the latest advancements in Swift, ensuring broader compatibility and efficiency.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics