Bug fix in Objective-C method signature parsing.

This commit is contained in:
gmp
2019-06-04 13:01:51 -04:00
parent 773886e0f1
commit f93a893060
4 changed files with 22 additions and 15 deletions
+7 -1
View File
@@ -1108,6 +1108,7 @@ func (w *Wrapper) MethodFromSig(sig,class string) *Method {
fmt.Printf("Failed to parse method signature %s (%s)\n",sig,rem)
os.Exit(-1)
}
i := 0 // count MethodParameters
for _,c := range n.Children {
switch c.Kind {
case "TypeName":
@@ -1124,9 +1125,14 @@ func (w *Wrapper) MethodFromSig(sig,class string) *Method {
tp := types.NewType(d,class)
p.Type = tp
case "Identifier":
p.Vname = d.Content
if i == 0 || p.Pname != "" {
p.Vname = d.Content
} else {
p.Pname = d.Content
}
}
}
i++
ret.Parameters = append(ret.Parameters,p)
}
}