(
self,
*fields: str,
declarations: str = ''
)
| 347 | self.limited_capi = False |
| 348 | |
| 349 | def parser_body( |
| 350 | self, |
| 351 | *fields: str, |
| 352 | declarations: str = '' |
| 353 | ) -> None: |
| 354 | lines = [self.parser_prototype] |
| 355 | self.parser_body_fields = fields |
| 356 | |
| 357 | preamble = libclinic.normalize_snippet(""" |
| 358 | {{ |
| 359 | {return_value_declaration} |
| 360 | {parser_declarations} |
| 361 | {declarations} |
| 362 | {initializers} |
| 363 | """) + "\n" |
| 364 | finale = libclinic.normalize_snippet(""" |
| 365 | {modifications} |
| 366 | {lock} |
| 367 | {return_value} = {c_basename}_impl({impl_arguments}); |
| 368 | {unlock} |
| 369 | {return_conversion} |
| 370 | {post_parsing} |
| 371 | |
| 372 | {exit_label} |
| 373 | {cleanup} |
| 374 | return return_value; |
| 375 | }} |
| 376 | """) |
| 377 | for field in preamble, *fields, finale: |
| 378 | lines.append(field) |
| 379 | code = libclinic.linear_format("\n".join(lines), |
| 380 | parser_declarations=self.declarations) |
| 381 | self.parser_definition = code |
| 382 | |
| 383 | def parse_no_args(self) -> None: |
| 384 | parser_code: list[str] | None |
no test coverage detected