4 releases

0.2.2 Feb 22, 2020
0.2.1 Dec 28, 2019
0.2.0 Dec 19, 2019
0.1.0 Jun 30, 2019

#206 in Parser implementations

Download history 13/week @ 2020-06-04 12/week @ 2020-06-11 9/week @ 2020-06-18 38/week @ 2020-06-25 34/week @ 2020-07-02 183/week @ 2020-07-09 352/week @ 2020-07-16 472/week @ 2020-07-23 455/week @ 2020-07-30 344/week @ 2020-08-06 306/week @ 2020-08-13 242/week @ 2020-08-20 616/week @ 2020-08-27 843/week @ 2020-09-03 756/week @ 2020-09-10 863/week @ 2020-09-17

1,849 downloads per month
Used in 4 crates (via termwiz)

MIT license

42KB
940 lines

vtparse

This is an implementation of a parser for escape and control sequences. It is based on the DEC ANSI Parser.

It has been modified slightly to support UTF-8 sequences.

vtparse is the lowest level parser; it categorizes the basic types of sequences but does not ascribe any semantic meaning to them.

You may wish to look at termwiz::escape::parser::Parser in the termwiz crate if you're looking for semantic parsing.

Comparison with the vte crate

vtparse has support for dynamically sized OSC buffers, which makes it suitable for processing large escape sequences, such as those used by the iTerm2 image protocol.


lib.rs:

An implementation of the state machine described by DEC ANSI Parser, modified to support UTF-8.

This is sufficient to broadly categorize ANSI/ECMA-48 escape sequences that are commonly used in terminal emulators. It does not ascribe semantic meaning to those escape sequences; for example, if you wish to parse the SGR sequence that makes text bold, you will need to know which codes correspond to bold in your implementation of VTActor.

You may wish to use termwiz::escape::parser::Parser in the termwiz crate if you don't want to have to research all those possible escape sequences for yourself.

Dependencies

~14KB