p101_is 1.0.0

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

/// Points of origin of conditional 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
#[allow(non_camel_case_types)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum ConditionalOrigin {
    _V,
    _W,
    _Y,
    _Z,
    cV,
    cW,
    cY,
    cZ,
    dV,
    dW,
    dY,
    dZ,
    rV,
    rW,
    rY,
    rZ,
}

impl fmt::Display  for ConditionalOrigin {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        let text =  match self {
            ConditionalOrigin::_V => "/V",
            ConditionalOrigin::_W => "/W",
            ConditionalOrigin::_Y => "/Y",
            ConditionalOrigin::_Z => "/Z",
            ConditionalOrigin::cV => "cV",
            ConditionalOrigin::cW => "cW",
            ConditionalOrigin::cY => "cY",
            ConditionalOrigin::cZ => "cZ",
            ConditionalOrigin::dV => "dV",
            ConditionalOrigin::dW => "dW",
            ConditionalOrigin::dY => "dY",
            ConditionalOrigin::dZ => "dZ",
            ConditionalOrigin::rV => "rV",
            ConditionalOrigin::rW => "rW",
            ConditionalOrigin::rY => "rY",
            ConditionalOrigin::rZ => "rZ",
        };
        
        write!(f, "{}", text)
    }
}