infoterm 0.1.1

ncurses-compatible terminfo parsing library
Documentation
#[derive(Copy, Clone, Debug, Default)]
pub struct FormatFlags {
    pub minus: bool,
    pub plus: bool,
    pub hash: bool,
    pub space: bool,
}

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum FormatSpec {
    Decimal,
    Octal,
    LowerHex,
    UpperHex,
    String,
}

#[derive(Copy, Clone, Debug)]
pub struct Format {
    pub flags: FormatFlags,
    pub width: Option<u32>,
    pub precision: Option<u32>,
    pub spec: FormatSpec,
}

#[derive(Debug)]
pub enum Op<'a> {
    /// Regular output
    OutputBytes(&'a [u8]),
    /// `%%`
    OutputPercent,
    /// `%[[:]flags][width][.precision][doxXs]`
    OutputFormatted(Format),
    /// `%c`
    OutputChar,
    /// `%p[1-9]`
    PushParameter(usize),
    /// `%P[a-z]`
    SetDynamic(usize),
    /// `%g[a-z]`
    GetDynamic(usize),
    /// `%P[A-Z]`
    SetStatic(usize),
    /// `%g[A-Z]`
    GetStatic(usize),
    /// `%'c'`
    PushChar(char),
    /// `%{nn}`
    PushInt(i32),
    /// `%l`
    PushStringLength,
    /// `%+`
    Add,
    /// `%-`
    Sub,
    /// `%*`
    Mul,
    /// `%/`
    Div,
    /// `%m`
    Mod,
    /// `%&`
    BitAnd,
    /// `%|`
    BitOr,
    /// `%^`
    BitXor,
    /// `%=`
    Eq,
    /// `%>`
    Gt,
    /// `%<`
    Lt,
    /// `%A`
    BoolAnd,
    /// `%O`
    BoolOr,
    /// `%~`
    BitNot,
    /// `%!`
    BoolNot,
    /// `%i`
    AnsiIncrement,
    /// `%?`
    IfStart,
    /// `%t`
    Then,
    /// `%e`
    Else,
    /// `%;`
    IfEnd,
    /// End of string
    End,
}