Skip to content

Commit e93769d

Browse files
1bsylslouken
authored andcommitted
Extract the name of a callback paramter
1 parent 67a4094 commit e93769d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/dynapi/gendynapi.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,19 @@ def main():
215215
b = match.group(2).strip()
216216
c = match.group(3).strip()
217217

218-
# cut-off last word to get callback name
219-
d = b.rsplit('*', 1)[0]
218+
try:
219+
(param_type, param_name) = b.rsplit('*', 1)
220+
except:
221+
param_type = t;
222+
param_name = "param_name_not_specified"
223+
224+
# bug rsplit ??
225+
if param_name == "":
226+
param_name = "param_name_not_specified"
220227

221228
# recontruct a callback name for future parsing
222-
func_param_type.append(a + " (" + d + "*REWRITE_NAME)" + c)
229+
func_param_type.append(a + " (" + param_type.strip() + " *REWRITE_NAME)" + c)
230+
func_param_name.append(param_name.strip())
223231

224232
continue
225233

0 commit comments

Comments
 (0)