Skip to content

Conversation

@eugenebokhan
Copy link
Contributor

No description provided.

@eugenebokhan eugenebokhan requested a review from s1ddok March 13, 2021 13:52
@eugenebokhan eugenebokhan self-assigned this Mar 13, 2021

public func sanitizeResult() {
self.result = self.result
.replacingOccurrences(of: "simd_float2,", with: "SIMD2<Float>,")
Copy link
Owner

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?

Copy link
Contributor Author

@eugenebokhan eugenebokhan Mar 14, 2021

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.

Copy link
Contributor Author

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

var swiftTypeName = scanner.leftString
.trimmingCharacters(in: .whitespacesAndNewlines)
if #available(OSX 10.12, *),
let checkedType = TypeSanitizer.sanitizeType(swiftTypeName) {
Copy link
Owner

@s1ddok s1ddok Mar 22, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants