(argstr)
| 184 | raise ValueError("no match '%s' for '%s' (%r)" % (lbrac, rbrac, s)) |
| 185 | |
| 186 | def split_arguments(argstr): |
| 187 | arguments = [] |
| 188 | current_argument = [] |
| 189 | i = 0 |
| 190 | def finish_arg(): |
| 191 | if current_argument: |
| 192 | argstr = ''.join(current_argument).strip() |
| 193 | m = re.match(r'(.*(\s+|\*))(\w+)$', argstr) |
| 194 | if m: |
| 195 | typename = m.group(1).strip() |
| 196 | name = m.group(3) |
| 197 | else: |
| 198 | typename = argstr |
| 199 | name = '' |
| 200 | arguments.append((typename, name)) |
| 201 | del current_argument[:] |
| 202 | while i < len(argstr): |
| 203 | c = argstr[i] |
| 204 | if c == ',': |
| 205 | finish_arg() |
| 206 | elif c == '(': |
| 207 | p = skip_brackets(argstr[i:], '(', ')') |
| 208 | current_argument += argstr[i:i+p] |
| 209 | i += p-1 |
| 210 | else: |
| 211 | current_argument += c |
| 212 | i += 1 |
| 213 | finish_arg() |
| 214 | return arguments |
| 215 | |
| 216 | |
| 217 | def find_functions(filename, tag='API'): |
no test coverage detected