Skip to content

Commit

Permalink
fix: objc parsing - always replace >< with , (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
t0rr3sp3dr0 authored Apr 29, 2024
1 parent 2adf8ce commit ea4593c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions types/objc/type_encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ func getPropertyType(attrs string) (typ string) {
}
if strings.HasPrefix(attr, "@\"") {
typ = strings.Trim(attr, "@\"")
typ = strings.ReplaceAll(typ, "><", ", ")
if strings.HasPrefix(typ, "<") {
typ = "id " + strings.ReplaceAll(typ, "><", ", ") + " "
typ = "id " + typ + " "
} else {
typ += " *"
}
Expand Down Expand Up @@ -249,8 +250,9 @@ func getPropertyAttributeTypes(attrs string) (string, bool) {
func getIVarType(ivType string) string {
if strings.HasPrefix(ivType, "@\"") && len(ivType) > 1 {
ivType = strings.Trim(ivType, "@\"")
ivType = strings.ReplaceAll(ivType, "><", ", ")
if strings.HasPrefix(ivType, "<") {
return "id " + strings.ReplaceAll(ivType, "><", ", ") + " "
return "id " + ivType + " "
}
return ivType + " *"
}
Expand Down

0 comments on commit ea4593c

Please sign in to comment.