(self, creator = 'Function')
| 242 | print() |
| 243 | |
| 244 | def parse_prototype(self, creator = 'Function'): |
| 245 | if self.match('extern', 'virtual'): |
| 246 | self.consume() |
| 247 | |
| 248 | ret = self.parse_type() |
| 249 | |
| 250 | if self.match('__stdcall', 'WINAPI', 'STDMETHODCALLTYPE'): |
| 251 | self.consume() |
| 252 | creator = 'Std' + creator |
| 253 | |
| 254 | name = self.consume() |
| 255 | extra = '' |
| 256 | if not self.has_side_effects(name): |
| 257 | extra += ', sideeffects=False' |
| 258 | name = name |
| 259 | |
| 260 | self.consume('(') |
| 261 | args = [] |
| 262 | if self.match('void') and self.tokens[1] == ')': |
| 263 | self.consume() |
| 264 | while self.lookahead() != ')': |
| 265 | arg = self.parse_arg() |
| 266 | args.append(arg) |
| 267 | if self.match(','): |
| 268 | self.consume() |
| 269 | self.consume(')') |
| 270 | if self.match('const', 'CONST'): |
| 271 | self.consume() |
| 272 | extra = ', const=True' + extra |
| 273 | |
| 274 | if self.lookahead() == '=': |
| 275 | self.consume() |
| 276 | self.consume('0') |
| 277 | |
| 278 | print(' %s(%s, "%s", [%s]%s),' % (creator, ret, name, ', '.join(args), extra)) |
| 279 | |
| 280 | def parse_arg(self): |
| 281 | tags = self.parse_tags() |
no test coverage detected