CwlDemangle
CwlDemangle copied to clipboard
Mangling back?
Sorry for the very weird question 😅
Is there a way to go back to the mangled version?
If for instance if I have a function:
Mangled:
$s6Module3FooC3bar3bazSayAA3BarVGSi_tF
Demangled:
Module.Foo.bar(baz: Swift.Int) -> Swift.Array<Module.Bar>
And if I want a specific part mangled back. For example for Swift.Int:
$sSiN
I'm not looking for anyone to fix this for me. I'm happy to implement it myself 🙃 . Would just like some idea of how to change the code to accommodate.
My idea so far was to keep track of the area in the mangled string for a specific node in the AST and just store that, in the SwiftSymbol Object. But we still need to resolve how to mangle the module name back: i.e. how do I go from Swift.Array<Module.Bar> to $s[...]6Module3Bar[...]?