Sfoglia il codice sorgente

Extract the name of a callback paramter

Sylvain 2 anni fa
parent
commit
e93769d2c9
1 ha cambiato i file con 11 aggiunte e 3 eliminazioni
  1. 11 3
      src/dynapi/gendynapi.py

+ 11 - 3
src/dynapi/gendynapi.py

@@ -215,11 +215,19 @@ def main():
                     b = match.group(2).strip()
                     c = match.group(3).strip()
 
-                    # cut-off last word to get callback name
-                    d = b.rsplit('*', 1)[0]
+                    try:
+                        (param_type, param_name) = b.rsplit('*', 1)
+                    except:
+                        param_type = t;
+                        param_name = "param_name_not_specified"
+
+                    # bug rsplit ??
+                    if param_name == "":
+                        param_name = "param_name_not_specified"
 
                     # recontruct a callback name for future parsing
-                    func_param_type.append(a + " (" + d + "*REWRITE_NAME)" + c)
+                    func_param_type.append(a + " (" + param_type.strip() + " *REWRITE_NAME)" + c)
+                    func_param_name.append(param_name.strip())
 
                     continue