csi_parser 0.1.0

CSI escape code parser.
Documentation
csi_parser-0.1.0 has been yanked.

CSI parser

This is a simple CSI parser that only provides parsing for a subset of common CSI.

If you have additional requirements, feel free to submit a PR (Pull Request)

Please refer to the definition of CSI.

See the rs docs.

Look at progress and contribute on github.

Example

use csi_parser::enums::CSISequence;
use csi_parser::parser::parse;

fn main() {
    let t = "👋, \x1b[31;4m🌍\x1b[0m!";
    let mut csi_seqs = vec![];
    for x in parse(t) {
        let csi_seq: CSISequence = x.into();
        csi_seqs.push(csi_seq);
    }
    println!("{:#?}", csi_seqs);
}

and you will be got the result:

[
    Color(
        Some(
            31,
        ),
        None,
        Some(
            4,
        ),
    ),
    Color(
        Some(
            0,
        ),
        None,
        None,
    ),
]