(self)
| 594 | |
| 595 | @contextual |
| 596 | def pseudo_def(self) -> Pseudo | None: |
| 597 | if (tkn := self.expect(lx.IDENTIFIER)) and tkn.text == "pseudo": |
| 598 | size = None |
| 599 | if self.expect(lx.LPAREN): |
| 600 | if tkn := self.expect(lx.IDENTIFIER): |
| 601 | if self.expect(lx.COMMA): |
| 602 | inp, outp = self.io_effect() |
| 603 | if self.expect(lx.COMMA): |
| 604 | flags = self.flags() |
| 605 | else: |
| 606 | flags = [] |
| 607 | if self.expect(lx.RPAREN): |
| 608 | if self.expect(lx.EQUALS): |
| 609 | if self.expect(lx.LBRACE): |
| 610 | as_sequence = False |
| 611 | closing = lx.RBRACE |
| 612 | elif self.expect(lx.LBRACKET): |
| 613 | as_sequence = True |
| 614 | closing = lx.RBRACKET |
| 615 | else: |
| 616 | raise self.make_syntax_error("Expected { or [") |
| 617 | if members := self.members(allow_sequence=True): |
| 618 | if self.expect(closing) and self.expect(lx.SEMI): |
| 619 | return Pseudo( |
| 620 | tkn.text, inp, outp, flags, members, as_sequence |
| 621 | ) |
| 622 | return None |
| 623 | |
| 624 | def members(self, allow_sequence : bool=False) -> list[str] | None: |
| 625 | here = self.getpos() |
no test coverage detected