Return the integer value as a Python int.
(self)
| 557 | __slots__ = () |
| 558 | |
| 559 | def as_long(self) -> int: |
| 560 | """Return the integer value as a Python int.""" |
| 561 | if isinstance(self._ast, IntLit): |
| 562 | return self._ast.val |
| 563 | if isinstance(self._ast, NatLit): |
| 564 | return self._ast.val |
| 565 | raise TypeError("Not an integer literal") |
| 566 | |
| 567 | def as_string(self) -> str: |
| 568 | return str(self.as_long()) |