Decode Ix.Int from Lean object. Ix.Int: ofNat (tag 0, 1 field) | negSucc (tag 1, 1 field)
(&self)
| 36 | /// Decode Ix.Int from Lean object. |
| 37 | /// Ix.Int: ofNat (tag 0, 1 field) | negSucc (tag 1, 1 field) |
| 38 | pub fn decode(&self) -> Int { |
| 39 | let ctor = self.as_ctor(); |
| 40 | let nat = LeanNat::to_nat(&ctor.get(0)); |
| 41 | match ctor.tag() { |
| 42 | 0 => Int::OfNat(nat), |
| 43 | 1 => Int::NegSucc(nat), |
| 44 | _ => panic!("Invalid Ix.Int tag: {}", ctor.tag()), |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | impl LeanIxSubstring<LeanOwned> { |
no test coverage detected