Skip to content

Commit

Permalink
Xcode is not very clever, it tries to build the generator for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed Oct 3, 2024
1 parent 1ca5db0 commit e29f317
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Generator/Generator/MethodGen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,22 @@ struct MethodArgument {
}

self.name = godotArgumentToSwift(src.name)


// Splits a string that might contain '::' into either two, or a single element
func typeSplit (_ type: String) -> [String.SubSequence] {
if let r = type.range(of: "::") {
return [
type[type.startIndex..<r.lowerBound],
type[r.upperBound...]
]
} else {
return [type [type.startIndex...]]
}
}
if src.type.contains("*") {
translation = .cPointer
} else {
let tokens = src.type.split(separator: "::")
let tokens = typeSplit (src.type)

switch tokens.count {
case 1:
Expand Down

0 comments on commit e29f317

Please sign in to comment.