/
View dependency graph
Depends on
- dh-cargo (dh-sequence-cargo)
- cargo, debhelper-compat, librust-nom-7+default-dev, librust-nom-7+std-dev, librust-vte-0.15+default-dev, libstd-rust-dev, rustc
Used by
README (full)
ansi escape codes tokenization
This is a library for parsing ANSI escape sequences.
The list of covered sequences.
- Cursor Position
- Cursor {Up, Down, Forward, Backward}
- Cursor {Save, Restore}
- Erase Display
- Erase Line
- Set Graphics mode
- Set/Reset Text Mode
Usage
let text = "\x1b[31;1;4mHello World\x1b[0m";
for e in parse_ansi(text) {
match e.kind() {
ElementKind::Text => {
println!("Got a text: {:?}", &text[e.range()],);
}
_ => {
println!(
"Got an escape sequence: {:?} from {:#?} to {:#?}",
e.kind(),
e.start(),
e.end()
);
}
}
}
no_std support
no_std is supported via disabling the std feature in your Cargo.toml.
Notes
The project got an insiration from https://gitlab.com/davidbittner/ansi-parser.
| dir | debian/ |
| dir | examples/ |
| dir | src/ |
| dir | tests/ |
| file | .cargo_vcs_info.json |
| file | .gitignore |
| file | .gitlab-ci.yml |
| file | Cargo.lock |
| file | Cargo.toml |
| file | Cargo.toml.orig |
| file | LICENSE |
| file | README.md |