Return object as INTEGER constant.
(obj, kind=4)
| 960 | |
| 961 | |
| 962 | def as_integer(obj, kind=4): |
| 963 | """Return object as INTEGER constant. |
| 964 | """ |
| 965 | if isinstance(obj, int): |
| 966 | return Expr(Op.INTEGER, (obj, kind)) |
| 967 | if isinstance(obj, Expr): |
| 968 | if obj.op is Op.INTEGER: |
| 969 | return obj |
| 970 | raise OpError(f'cannot convert {obj} to INTEGER constant') |
| 971 | |
| 972 | |
| 973 | def as_real(obj, kind=4): |
no test coverage detected
searching dependent graphs…