-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sanitise result #18
base: master
Are you sure you want to change the base?
sanitise result #18
Conversation
|
||
public func sanitizeResult() { | ||
self.result = self.result | ||
.replacingOccurrences(of: "simd_float2,", with: "SIMD2<Float>,") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why include commas and brackets into replacement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to ignore float2x2, float3x3 etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the pr looks hacky, but does the job
.trimmingCharacters(in: .whitespacesAndNewlines) | ||
if #available(OSX 10.12, *), | ||
let checkedType = TypeSanitizer.sanitizeType(swiftTypeName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can have it, at least as an experimental feature, but we defintely need to introduce a command line argument parameter for this
also, you have to keep in mind that users can use aliases/typenames of their private codebase and that is totally fine (we do not limit swift type usage to simd) hence your approach won't work for such types. I see that we check for nil here but still. I think what we can do instead is introduce a simple dictionary here and try map swiftTypeName
to something else
No description provided.