(self)
| 534 | |
| 535 | @contextual |
| 536 | def uop(self) -> UOp | None: |
| 537 | if tkn := self.expect(lx.IDENTIFIER): |
| 538 | if self.expect(lx.DIVIDE): |
| 539 | sign = 1 |
| 540 | if negate := self.expect(lx.MINUS): |
| 541 | sign = -1 |
| 542 | if num := self.expect(lx.NUMBER): |
| 543 | try: |
| 544 | size = sign * int(num.text) |
| 545 | except ValueError: |
| 546 | raise self.make_syntax_error( |
| 547 | f"Expected integer, got {num.text!r}" |
| 548 | ) |
| 549 | else: |
| 550 | return CacheEffect(tkn.text, size) |
| 551 | raise self.make_syntax_error("Expected integer") |
| 552 | else: |
| 553 | return OpName(tkn.text) |
| 554 | return None |
| 555 | |
| 556 | @contextual |
| 557 | def family_def(self) -> Family | None: |
no test coverage detected