Skip to content

Commit 95df46b

Browse files
authored
5 9 1 (#4)
* version 5.9.1 * remove test warning * test failed $s17distributed_thunk2DAC1fyyFTE * test failed $s17distributed_thunk2DAC1fyyFTE * test succeed $s17distributed_thunk2DAC1fyyFTE * test failed $s27distributed_actor_accessors7MyActorC7simple2ySSSiFTETFHF * test succeed $s27distributed_actor_accessors7MyActorC7simple2ySSSiFTETFHF * fail test$s1A3bar1aySSYt_tF * fail test$s1A3bar1aySSYt_tF * add dump debug information flag * succeed test$s1A3bar1aySSYt_tF * fail test$s1t1fyyFSiAA3StrVcs7KeyPathCyADSiGcfu_SiADcfu0_33_556644b740b1b333fecb81e55a7cce98ADSiTf3npk_n * succeed test$s1t1fyyFSiAA3StrVcs7KeyPathCyADSiGcfu_SiADcfu0_33_556644b740b1b333fecb81e55a7cce98ADSiTf3npk_n * fail test$s21back_deploy_attribute0A12DeployedFuncyyFTwb * succeed test$s21back_deploy_attribute0A12DeployedFuncyyFTwb * fail test$sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTATQ0_ * succeed test$sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTATQ0_ * fail test$s14swift_ide_test14myColorLiteral3red5green4blue5alphaAA0E0VSf_S3ftcfm * succeed test$s14swift_ide_test14myColorLiteral3red5green4blue5alphaAA0E0VSf_S3ftcfm * succeed test$s4main4FlagVHa * succeed test$s9MacroUser13testStringify1a1bySi_SitF9stringifyfMf1_ * fail test__swiftmacro_1a13testStringifyAA1bySi_SitF9stringifyfMf_ * succeed test__swiftmacro_1a13testStringifyAA1bySi_SitF9stringifyfMf_ * failed test_$s4main1fSiyYaFTQ0_ * remove Character.isDigit * update README.md
1 parent bd8933c commit 95df46b

17 files changed

Lines changed: 1911 additions & 954 deletions

README.md

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,55 @@
44

55
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Foozoofrog%2FSwiftDemangle%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/oozoofrog/SwiftDemangle)
66

7-
demangler for mangled symbol that translated from [swift-demangle](https://github.com/apple/swift/blob/main/tools/swift-demangle/swift-demangle.cpp) [Swift 5.5](https://github.com/apple/swift/tree/release/5.5)
7+
# SwiftDemangle
8+
9+
## Overview
10+
11+
`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.
12+
13+
## What's New in 5.9.1
14+
15+
Version 5.9.1 of SwiftDemangle brings several exciting enhancements, extending support for Swift's latest 5.9 demangle grammar. Key updates include:
16+
17+
- **Builtin Vector and Floating-Point Types:** Demangle builtin types like vectors and floating-point types.
18+
- **Outlined Read-Only Object Parsing:** Improved parsing for outlined read-only objects.
19+
- **Protocol and Conformance Descriptor Parsing:** Enhanced parsing for protocol and conformance descriptor runtime records.
20+
- **Nominal Type Descriptor and Opaque Type Descriptor:** Support for nominal and opaque type descriptor runtime records.
21+
- **Advanced Generic Specialization Parsing:** Improved parsing for generic specializations in Swift.
22+
- **Distributed Thunk and Accessible Function Records:** Enhanced parsing for distributed thunk and accessible function runtime records.
23+
- **Macro Expansion Parsing:** Improved parsing for macro expansions in various contexts.
24+
25+
These additions enhance SwiftDemangle's capabilities, making it an indispensable tool for Swift developers.
826

927
## Installation
10-
**SwiftDemangle** supply **SPM** only
11-
```swift
28+
29+
```Swift
30+
# If using Swift Package Manager
1231
dependencies: [
13-
.package(url: "https://github.com/oozoofrog/SwiftDemangle", from: "5.5.8"),
14-
],
32+
.package(url: "https://github.com/oozoofrog/SwiftDemangle", .upToNextMajor(from: "5.9.1"))
33+
]
1534
```
1635

1736
## Usage
1837

1938
```Swift
2039
import SwiftDemangle
2140

22-
print("_TFCs13_NSSwiftArray29canStoreElementsOfDynamicTypefPMP_Sb".demangled)
41+
// Example 1: Demangling a Builtin Vector Type
42+
let mangledVector = "_TtBv4Bf16_"
43+
let demangledVector = SwiftDemangle.demangle(mangledVector)
44+
print(demangledVector) // Output: Builtin.Vec4xFPIEEE16
45+
46+
// Example 2: Demangling a Protocol Descriptor
47+
let mangledProtocol = "$ss6SimpleHr"
48+
let demangledProtocol = SwiftDemangle.demangle(mangledProtocol)
49+
print(demangledProtocol) // Output: protocol descriptor runtime record for Swift.Simple
2350
```
51+
52+
## Contributing
53+
54+
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.
55+
56+
## License
57+
58+
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.

Sources/SwiftDemangle/Demangler/DemangleOptions.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,19 @@ public struct DemangleOptions: OptionSet {
6060
]
6161

6262
public static let simplifiedOptions: DemangleOptions = [
63-
.synthesizeSugarOnTypes, .qualifyEntities, .displayLocalNameContexts, shortenPartialApply, .shortenThunk, .shortenValueWitness, .shortenArchetype, .displayDebuggerGeneratedModule, .displayStdlibModule, .displayObjCModule, .showAsyncResumePartial
63+
.synthesizeSugarOnTypes,
64+
.qualifyEntities,
65+
.displayLocalNameContexts,
66+
.shortenPartialApply,
67+
.shortenThunk,
68+
.shortenValueWitness,
69+
.shortenArchetype,
70+
.displayDebuggerGeneratedModule,
71+
.displayStdlibModule,
72+
.displayObjCModule,
73+
// .showAsyncResumePartial,
6474
]
65-
75+
6676
func genericParameterName(depth: UInt64, index: UInt64) -> String {
6777
var name = ""
6878
var index = index

0 commit comments

Comments
 (0)