CwlDemangle
CwlDemangle copied to clipboard
Raw identifier support (from Swift 6.2)
Raw identifier support will land in the upcoming Swift 6.2 release, which allows the use of a bunch of characters in an identifier which was not possible before.
I appreciate the work of maintaining this wonderful library. However, I noticed that it may fail to produce correct identifier in some cases with this feature used, eg.:
-
$s6output0018tasksend_jxJBbEnja4taskySS_tF(produced by https://godbolt.org/z/Gx4d37nGo) should be correctly demangled asoutput.`task/send`(task: Swift.String) -> (), butCwlDemangleoutputsoutput..task.send.(task: Swift.String) -> (); -
$s6output0020sendtask_miaJCEDGcja4taskySS_tF(produced by https://godbolt.org/z/W3hv5db5z) should be correctly demangled asoutput.`send task`(task: Swift.String) -> (), butCwlDemangleoutputsoutput..send task.(task: Swift.String) -> ().
It does correctly demangle identifiers like `100` (though the formatting is wrong: raw identifiers should always have surrounding backticks), so I suspect most failures should be related to punycoding.
For the design and implementation detail of the feature, see:
- https://github.com/swiftlang/swift-evolution/blob/main/proposals/0451-escaped-identifiers.md
- https://github.com/swiftlang/swift/pull/76636