Exemple #1
0
func FuncStub(pkg *tp.Package, fun *tp.Function) string {
	name := null.GetString(fun.Name)
	args := ""
	for _, arg := range fun.Args {
		t := pkg.Types[int(null.GetInt32(arg.TypeId))]
		argName := null.GetString(t.Name)
		argName = argName + " %" + null.GetString(arg.Name)
		args = args + ", " + argName
	}
	if len(args) > 1 {
		args = args[2:]
	}
	returnVal := name + "(" + args + ") " + fun.ReturnTypeString(pkg) + " "
	opens := fun.OpensTypeString(pkg)
	if opens != "Base" {
		returnVal = returnVal + opens
	}
	return returnVal
}