p101_is 1.0.0

Represent Olivetti Programma 101 programs
Documentation
use std::fmt;

/// Points of origin of unconditional jumps.
/// An abbreviated form of this list is to combine V, W, Y or Z as follows:
/// ∆  -> A∆
/// C∆ -> B∆
/// D∆ -> E∆
/// R∆ -> F∆
/// ∆ = V, W, Y or Z
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Origin {
    V,
    W,
    Y,
    Z,
    CV,
    CW,
    CY,
    CZ,
    DV,
    DW,
    DY,
    DZ,
    RV,
    RW,
    RY,
    RZ,
}

impl fmt::Display  for Origin {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        let text =  match self {
            Origin::V => "V",
            Origin::W => "W",
            Origin::Y => "Y",
            Origin::Z => "Z",
            Origin::CV => "CV",
            Origin::CW => "CW",
            Origin::CY => "CY",
            Origin::CZ => "CZ",
            Origin::DV => "DV",
            Origin::DW => "DW",
            Origin::DY => "DY",
            Origin::DZ => "DZ",
            Origin::RV => "RV",
            Origin::RW => "RW",
            Origin::RY => "RY",
            Origin::RZ => "RZ",
        };

        write!(f, "{}", text)
    }
}