| 542 | self.state(line) |
| 543 | |
| 544 | def state_dsl_start(self, line: str) -> None: |
| 545 | if not self.valid_line(line): |
| 546 | return |
| 547 | |
| 548 | # is it a directive? |
| 549 | fields = shlex.split(line) |
| 550 | directive_name = fields[0] |
| 551 | directive = self.directives.get(directive_name, None) |
| 552 | if directive: |
| 553 | try: |
| 554 | directive(*fields[1:]) |
| 555 | except TypeError as e: |
| 556 | fail(str(e)) |
| 557 | return |
| 558 | |
| 559 | self.next(self.state_modulename_name, line) |
| 560 | |
| 561 | def parse_function_names(self, line: str) -> FunctionNames: |
| 562 | left, as_, right = line.partition(' as ') |